I have change default root shell to wrong path. Now the first line of /etc/passwd is look like the following string:
root:x:0:0:root:/root:/usr/bin/bash
Then I logout from server and now cannot log in by root.
There is no other user on server.
I know, here is much stupid mistakes, but how I can fix it?
Access to server is available only by ssh.
UPDATE
The mission is impossible.
I found a way to execute any command as www-data user.
How can I change /etc/passwd as non-sudo user?
ssh -t thatserver /bin/bashmight be one thing to try – thrig Feb 26 '16 at 19:49.ssh/authorized_keysbut if you never put your key there - hope is dead and you need physicall access or iLO/other console – Ivan Temchenko Feb 26 '16 at 19:55id_rsato acces by key. But now when I usessh root@host -i ~/.ssh/id_rsathe server ask me about password. – Sild Feb 26 '16 at 19:57.ssh/id_rsa.pub? what you got on runningssh root@host? – Ivan Temchenko Feb 26 '16 at 20:06