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.
Asked
Active
Viewed 357 times
1
1 Answers
0
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

Jakuje
- 6,605
- 7
- 30
- 37
-
Ok... Great answer! But is there a certain port I have to allow? Or what is the port so I can access it remotely – Noah Jan 17 '16 at 16:11
-
1Default port for ssh is 22. You should allow it in your firewall if you use one. – Jakuje Jan 17 '16 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? – Noah Jan 19 '16 at 00: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 – Sergiy Kolodyazhnyy Jan 17 '16 at 07:31