How to reset default ssh password in Ubuntu?
Solution 1:
By default, ssh
disables root login: you are expected to log in as user and then use su
or sudo
to become root.
This is an extra security step: if an invader knows or discovers the user password, he can ssh
the machine but not become root.
That said, if you want to disable this behaviour, edit /etc/ssh/sshd_config
and add the line PermitRootLogin Yes
.
Solution 2:
On the machine you want to log into, as a non-root user, type:
sudo passwd root
And you'll be prompted for a new password (after you type your own non-root password)
One little note: there's no such thing as an ‘ssh password’. SSH (unless you set it up in very specific ways, all of which are fairly complex and totally beyond the scope of the question), authenticates against the standard Unix user database (/etc/passwd
, /etc/shadow
, /etc/group
). You'll be changing root's own password.