2/11/2024 0 Comments Sudo su vs su![]() The above command deleted the Documents directory as a user john. We can also run a command as another user provided we have root privileges, Tasks such as editing important files, updating the system, rebooting the system require elevated privileges.Ī normal user cannot reboot a system and therefore for this the user needs to elevate his/her privileges by using sudo, sudo reboot Sudo will now have to wait 10 minutes before prompting for a password again. To change timeout for a user, we write, Defaults:john time_stamp=10 We can change this by editing the sudoers file as follows, sudo visudoĬhanging the default timeout, Defaults timestamp_timeout=10 ![]() To allow john to execute sudo command without a password prompt by editing the file as follows, john ALL=(ALL) NOPASSWD: ALLĪfter entering the password when sudo is invoked, by default the timeout is set to 5 minutes before any other sudo user command requires a password again. To allow a user john to only execute chmod command as sudo, we edit the file as follows, sudo visudo We can also limit the programs a user can execute as sudo by editing this file. To add a user to this group we write, usermod -aG sudo username Members of the sudo group which is defined in the sudoers file have administrative rights and are able to execute any command as the root user. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |