1. Add a user
#useradd -g users admin
#passwd admin
2. #visudo
here insert the below line in the end.
admin ALL=(ALL) NOPASSWD: ALL
with NOPASSWD it will not prompt for admin users password
Now if you want to give permissions to just few services instead of full privilege
1. #visudo
2. admin ALL=(root) NOPASSWD: /etc/init.d/postgresql
Save and Exit as :wq
now
# sudo /etc/init.d/postgresql start
will start the postgresql service without asking your password.
Now if you want to prohibit a users for accessing few services say shell, su,passwd or visudo
admin ALL = ALL, !SHELLS, !SU, !PASSWD, !VISUDO
No comments:
Post a Comment