How to Set Up and Change SSH Password

preview_player
Показать описание
Follow this easy step by step tutorial to learn how to set SSH password and how to change it.

In UNIX platform, a password for SSH does not exists, a separate user-id and password is not required to login to a remote system, it uses the user account details of the UNIX system itself. In this tutorial we will guide you on how to set up and change the ssh password in Linux.

Step#1: Setup an SSH password

If we open up the terminal application and try connecting to the local host using the root user, an error would appear stating that the permission is denied. That is because by default SSH disables root login as a security measure.
That means, to setup a password for ssh for the root user, we would have to edit the ssh configuration file.
For that, we will open up the ssh configuration file in the graphical editor using the command:
gedit /etc/ssh/sshd_config
In the configuration, move to the authentication section and change the value for Permit Root Login from no to yes. With that done, you can close the editor window and get back to the terminal.

Step#2: SSH login with password

Over here, let's restart the ssh service for the changes to take effect.
Now let's try to connect to the local host as the root user and you would notice that a new session will be created with the root user. That means the ssh password has been successfully configured.

Step#3: Change password

To change the ssh password, you can simply change the password of the username you are connecting with. Since we are logged in as the root user, we will type
sudo passwd followed by the username, which in this case is root.

Step#4: Update new password

With that done, you can now type the new password which you want to keep. Next, you would be required to re-type the password as a security check.
Once done, the password would be successfully changed.
And that's it.
Рекомендации по теме
Комментарии
Автор

I did a clean arch installation and was trying to setup cloud and stuff and i faced the issue and this method fixed it for me. THanks a lot

iamimmanuelraj
Автор

i love you!
Best video explained in less time then a 10 minute video !

Cyber_Official
Автор

Here you haven't mentioned how you set up password could you please suggest me

shivanaini
Автор

Thank you. Perfect in version 18.1 linux Mint. Greentings from

hiagokaic
Автор

Hi, that ubuntu software can install on windows 7 ?

rickysetiawan
Автор

i can not restart the ssh session after when i modified the config file still ask password for restart

falsepositive
Автор

typed in gedit says command not found this is starting to piss me off now

mayhem
Автор

Not a good idea to allow root login there.

nosajghoul