Could anybody tell me the exact steps to make a secure connection from my server to my external IP address using SSH... I would like to access my Ubuntu server from other places... But securely.
1 Answer
The linked answer is about SFTP, which is more complicated. Configuring ssh
server is much easier.
Step 1 : Install OpenSSH package if not installed
sudo apt-get install openssh-server
Step 2 : Add to your /etc/ssh/sshd_config
PermitRootLogin no
Step 3 : Restart sshd service.
sudo service ssh restart
Step 4 : Generate key pair on the computer from where you want to access your machine and copy the public part to your machine:
ssh-keygen -f ~/.ssh/id_rsa
ssh-copy-id -i ~/.ssh/id_rsa your_machine
-
Ok... Great answer! But is there a certain port I have to allow? Or what is the port so I can access it remotely– NoahJan 17, 2016 at 16:11
-
1Default port for ssh is 22. You should allow it in your firewall if you use one.– JakujeJan 17, 2016 at 19:40
-
When you say your machine... Do you mean your machine IP address or the name of it... Because I tried the name of my server and that did not work... How safe is this also... Even with the recent Open SSH Attacks... Could you explain the questions I have to me please?– NoahJan 19, 2016 at 0:40
PermitRootLogin no
in the/etc/ssh/sshd_config
file and use strong password for your personal account - that's 90% of security for you right there