CoreOS 添加用戶並賦予sudo權限

使用root賬號登錄CoreOS

username 爲你要添加的用戶登錄名

添加用戶到root組

useradd -g rot username

添加 sudo 權限

visudo -f /etc/sudoers.d/username

打開文件輸入

user1 ALL=(ALL) NOPASSWD: ALL

保存退出

使用username登錄系統,然後執行下面代碼檢查是否授權成功

username@server ~ $ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

參考:https://coreos.com/os/docs/latest/adding-users.html

xxx is not in the sudoers file. This incident will be reported.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章