Much like the title explains, SSH or Secure Shell is an encrypted networking tool. Aimed at allowing users of various systems access to a secure log in, SSH easily provides ample security.
“SSH, or Secure Shell, is a protocol used to securely log onto remote systems. It is the most common way to access remote Linux and UNIX-like servers.”
Fortunately, the setup is also relatively simple. As always, we’ll be utilizing the standard Linux terminal. In this case, our example OS is Ubuntu.
Let’s get rolling (always select ‘Y’ when prompted):
- (sudo) apt-get install openssh-server – installation
- cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults – make a copy of the default SSH configuration and rename it as factory default
- chmod a-w /etc/ssh/sshd_config.factory-defaults – modify the permissions
- gedit /etc/ssh/sshd_config – tweaking configuration file (if necessary)
- restart ssh – OR for Ubuntu 15.04+ users – systemctl restart ssh
- mkdir ~/.ssh – create a folder where your generated key will be saved
- chmod 700 ~/.ssh – modify the permissions
- ssh-keygen -t rsa – generate your key
After getting SSH set up, you are officially ready to connect. Now the easiest connection method is obviously over LAN. Literally all you have to do is open the terminal and find the IP address of the machine running the SSH server. Do this by running the ifconfig command.
Once the IP address has been figured out, you can log into your SSH server by typing the following command in terminal: ssh username@ip.address.here
Obviously replace username with your username and IP address with your IP address. Now, connecting to your SSH server is also possible over the internet by setting your router up for port forwarding.
Every router is different, and so for the best luck you’ll need to research your specific device for successful results. The biggest thing to remember is to forward port 22 to the internet from whatever system is using the SSH server.
After these steps, you can follow the directions for connecting via LAN and you’ll be set!