In short, I have to execute a command (sudo nano /etc/passwd) using a Sudoer Account which I know the username and password but I have to login as a non-Sudoer Account
trial #1 su - $USER -s /bin/sh Not Working! since the Sudoer Account doesn't have a shell account (accidentally set to /bin/false)
I have Ubuntu machine with only 2 users: 1. Admin (sudoer) 2. Mysql (non-sudoer)
accidentally changed the admin user on /etc/passwd into /bin/false
now I cannot login as admin, but still can login as mysql as generic user, non-sudo
How could I change back the /etc/passwd?
Is there any way doing this?
I've tried su - $USER -s /bin/sh while login as user POSTGRES but it's not working, since I cannot get into the shell because of /bin/false applied on ADMIN
so sudo is the last hope.. I think..
is anyone know how to execute sudo on ADMIN while we're login as non-sudo user? ex.. login as USER_POSTGRES, and execute a sudo COMMAND as Admin?