Setting up remote access with private key

Globox19

New Member
Joined
Apr 18, 2020
Messages
4
Reaction score
2
Credits
0
Hello everyone,
I am trying to setup my first ever Linux server so as to use it to host the calls between the members of my family using Jitsi.

I am trying to do this using Ubuntu server. Maybe it's a bad idea/distro, if you think so feel free to tell me, I'm totally new to Linux.
It is running as a VM under Unraid.

Unfortunately, I am stuck even before intalling Jitsi.
In order to make my whole setup a bit more secure, I have decided to disable remote login using password and to set the public private key methodology as compulsory.

I have made a .ppk file with the private key and am trying to use it with PuttY to access remotely to my server, but I am getting this error message when trying to establish the connection :
Network error : Connection refused

Could someone please give me hints as to what I might be doing wrong?

List of things I've done so far:
  • Made my IP static
  • Redirect my domain name to my static IP
  • Set a static local IP for the Ubuntu server VM
  • Redirect incoming traffic on the 2222 port I set up as SSH port in the sshd file to the Ubuntu server VM's local static IP
I am actually trying to follow the steps of this tutorial :
but using an Ubuntu VM I run on my Unraid NAS instead of one I would rent from a company. I have gigabit fiber at home to I'm assuming it should be working fine with a Ryzen 2600 for a little Jitsi private server.

I would like to thank in advance all the people who will take a moment to read this.
 


When set up ssh key's. It's a pair. You need the public key and the private key.
You can do this with "puttygen" on windows. There is a procedure.
If you do it using puttygen, you move your mouse around to make the algorithm.
Then save the public key, then save the private key.
Then you copy the public key to /home/myuser/.ssh and rename it to authorized_keys.
(myuser is whatever user name you login as).

I prefer to do this the "Linux way"

ssh-keygen -t ecdsa -b 521
(I prefer ecdsa over rsa or dsa)
Adding a passphrase is more secure, but then it requires some typing every time you login.

This will make two files in your home directory id_ecdsa and id_ecdsa.pub.
Usually under /home/myuser/.ssh

cd /home/myuser/.ssh
cp id_ecdsa.pub authorized keys
chmod 644 authorized_keys
chown myuser authorized_keys

copy id_ecdsa file to your windows computer and use puttygen to import the key and
save the private key as a .ppk file. (If you're using windows).
In putty you go to the "ssh: auth" section and find your private key .ppk file.
Click ok. Then go back up to "session" and click save. Otherwise it will forget where
your key is.
 
Last edited:
When set up ssh key's. It's a pair. You need the public key and the private key.
You can do this with "puttygen" on windows. There is a procedure.
If you do it using puttygen, you move your mouse around to make the algorithm.
Then save the public key, then save the private key.
Then you copy the public key to /home/myuser/.ssh and rename it to authorized_keys.
(myuser is whatever user name you login as).

I prefer to do this the "Linux way"

ssh-keygen -t ecdsa -b 521
(I prefer ecdsa over rsa or dsa)
Adding a passphrase is more secure, but then it requires some typing every time you login.

This will make two files in your home directory id_ecdsa and id_ecdsa.pub.
Usually under /home/myuser/.ssh

cd /home/myuser/.ssh
cp id_ecdsa.pub authorized keys
chmod 644 authorized_keys
chown myuser authorized_keys

copy id_ecdsa file to your windows computer and use puttygen to import the key and
save the private key as a .ppk file. (If you're using windows).
In putty you go to the "ssh: auth" section and find your private key .ppk file.
Click ok. Then go back up to "session" and click save. Otherwise it will forget where
your key is.

Hi dos2unix!
I really would like to thank you a lot for your thorough reply. I finally got the connection to work using the public and private keys!
Actually my mistake was really dumb (as it is often the case).
I actually had forgotten to copy the "begin private key" and "end private key" lines (I'm not sure about the exact syntax as I am writing on my phone right now).
Once I included these two lines before and after the actual key everything worked just fine!
 

Members online


Top