View Single Post
Posts: 47 | Thanked: 78 times | Joined on May 2008
#4
qwerty12, you saved the a55 of my colleague who put /bin/root into the shell field of /etc/passwd for user root, and couldn't get root anymore :-)

One small note: maybe it would make sense by default to run /bin/bash instead of /bin/sh if it exists. I think if somebody installed bash, then it prefers bash over the default shell.

Also it would be better to run /bin/sh and /bin/bash with the -l option (login). This will load ~/.profile for the user account and possibly other stuff to set up the shell for root.

By the way, wouldn't it be easier to just install a file under /etc/sudoers.d/ with something like:

user ALL = NOPASSWD: ALL

? Then you can sudo any command. Or even with user's password (if removing NOPASSWD, just like in Ubuntu.
 

The Following User Says Thank You to anpaza For This Useful Post: