Configuring SSH
Last updated
Was this helpful?
Last updated
Was this helpful?
Going on, some files have been created and we need to configure them.
For that we will use or (we will need to install vim since it's not preinstalled using sudo apt install vim
) or any other text editor.
First file that we will edit will be /etc/ssh/sshd_config
. If you are not on root you will not be able to edit the file; as you know, for switching to root we use su
The #
means that line it is commented; the lines that we will be edit have to be uncommented. Once we are editing the file we need to update the following lines:
#Port 22 -> Port 4242
#PermitRootLogin prohibit-password -> PermitRootLogin no
When finish we have to save the changes and leave the file.
Now with the file /etc/ssh/ssh_config
. (not sshd_config
)
#Port 22 -> Port 4242
Finally we must restart the ssh service so it can be updated. For that purpuse we will use:
and once it is done we will check the service state with:
and confirm that everything is alright.