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/bash
might be one thing to try.ssh/authorized_keys
but if you never put your key there - hope is dead and you need physicall access or iLO/other consoleid_rsa
to acces by key. But now when I usessh root@host -i ~/.ssh/id_rsa
the server ask me about password.