Friday, August 30, 2019

Linux Users Configuration 使用者設定


Create a new user called 'jenkins' (create account)
sudo adduser jenkins

Delete a user called 'jenkins' (delete account)
sudo deluser jenkins

Add 'jenkins' to sudoer group (join to group)
sudo usermod -aG sudo jenkins

Remove 'jenkins' from sudoer group (delete from group)
sudo gpasswd -d jenkins sudo

Check any groups joined by this user (check joined group)
id jenkins

Check 'jenkins' user id (check userid)
id -u jenkins

Check group file
sudo vi /etc/group

Add 'jenkins' to the sudoers without requiring password all the time

sudo vi /etc/sudoers
jenkins   ALL=(ALL) NOPASSWD: ALL      #add this line
:wq                                    #save and exit