Sudo issue with admin account

Personally I open /etc/passwd with vi, modify that record, save it and exit. As a beginner vi is very daunting. You can do this:
vi /etc/passwd
use the arrow keys to move the cursor to the line that reads:
admin:x:1002:1003::/home/admin:/usr/bin/jailshell
when the cursor is over the slash in /usr/bin/jailshell you can type a capital 'D', it should erase from the cursor to the end of the line
type a lowercase 'a', this will all you to append to that line starting at the current position from there you can type the shell (i.e. /bin/sh)
when complete, hit the Esc key, this brings you out of edit mode. Now type ":x" without the quotes. The colon will display on the bottom left of the window and the x tells vi to save the edited file and exit.

Unfortunately DirectAdmin doesn't have an easy method for modifying /etc/passwd.

One more way to do this is if you do:
grep jailshell /etc/passwd
and there is ONLY one entry, and /usr/bin/bash exists, then you can do this:
perl -pi -e 's#/usr/bin/jailshell#/bin/bash#g' /etc/passwd

Just make sure that you change /bin/bash to a shell that already exists on your system.
I then re ran this:

chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo

And now it works! Thank you
 
did you log out and back in as admin? If you don't then you are still working with the jailed shell. If you did log out and back in then what do you see when you do:
grep admin /etc/passwd

I would expect to see the non-jailed shell
 
Back
Top