Hello everyone,
I'm trying to set up my first ubuntu server so as to be able to SSH into it remotely using a private key.
I have made it generate a private key using
Then I assigned this key to my user account (which is a linux admin but not root)
I have then tried to edit the sshd file using
But there is something a bit strange. In the tutorial I was following (i am very new to command line in Linux) the person was getting a lot of pre-commented code which he just had to un-comment. But for me the file seemed totally blank. I just typed in the lines that the guy was un-commenting :
Then I restarted the sshd and made my server display the private key :
And deleted the private key from the server :
I saved the private key to a .ppk text file, which I loaded in PuttyGen to be able to use the key conveniently with Putty to SSH into my server.
For some reason I am stuck and cannot successfully SSH into my server remotely though. I am getting this error message from Putty :
Could you please help me getting this to work?
I'm trying to set up my first ubuntu server so as to be able to SSH into it remotely using a private key.
I have made it generate a private key using
Code:
sudo ssh-keygen
Code:
sudo ssh-copy-id [email protected]
Code:
sudo nano -w /etc/ssh/sshd config
Code:
Port 2222
PermitRootLogin no
PasswordAuthentication no
Code:
sudo systemctl restart sshd
sudo cat ~/.ssh/id_rsa
Code:
sudo rm ~/.ssh/id_rsa
For some reason I am stuck and cannot successfully SSH into my server remotely though. I am getting this error message from Putty :
Network error : Connection refused
Could you please help me getting this to work?