使用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.