docker需要root用户启动守护进程


docker需要root用户启动守护进程

[root@yang ~]# useradd yang

[root@yang ~]# usermod -a -G docker yang

[root@yang ~]# id yang
uid=1002(yang) gid=1002(yang) 组=1002(yang),994(docker)
[root@yang ~]# groups yang
yang : yang docker

# 使用root用户停止docker
[root@yang ~]# systemctl stop docker
Warning: Stopping docker.service, but it can still be activated by:
  docker.socket


# 切到yang用户
[root@yang ~]# su - yang

# 尝试启动docker
[yang@yang ~]$ systemctl start docker
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units. # 管理系统服务或单元需要身份验证
Authenticating as: root # 身份验证为:root
Password: # 需要输入root密码才能启动docker


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM