Install SSH server
I hope that you successfully installed the Ubuntu Linux server. The next step is to install the Ubuntu SSH server (SSH is a secure remote shell).
I would advise you to install a SSH server as it will allow you remotely check and change the server configuration or install new packages and the updates. All its communications are encrypted and it is more secure than Telnet. SSH is the standard for all remote configuration and remote management in the industry.
It is worth to mention that the SFTP (secure file transfer protocol) is implemented as part of the SSH protocol. So, you don’t need to do any additional configuration to get it. This protocol can be quite handy for transferring files either from home or from the Internet.
You have to login into your server’s shell by using the username and password which you created during the server basic setup and enter the following commands to install the SSH service:
sudo apt-get update
sudo apt-get install openssh-server
You can check if your SSH service is running by issuing the comand:
It should return:
You can check if your SSH server is properly configured by entering the command:
Because you are connecting for the 1st time to the SSH server, it will show the warning, which you have to accept:
The SSH server configuration file is located under the path /etc/ssh/sshd_config. You can change the configuration by entering the command:
sudo nano /etc/ssh/sshd_config
There are many options for the SSH server. If you are interested in this, you can read more on OpenSSH website.
Many times the SSH server was authenticating quite slowly, as it appeared it was checking if my DNS name maps back to the very same IP address.
If you want the SSH server authenticate faster, one setting “UseDNS” within sshd_config file needs to be disabled “UseDNS=NO”. Later, you have restart the SSH server by entering the command:
sudo /etc/init.d/ssh restart
The server’s part is finished!
What is left – just to explain how to use access the SSH & SFTP services.
Using a SSH client
If you use Windows PC, you will need a SSH client program – Putty.
This program can be downloaded from the author’s website and it is freeware.
The programs interface is shown below:
You have to enter your Ubuntu server IP address in the field “Host Name (or IP address)” and the port number. After this, you can provide the name in the field “Saved Sessions” and click the button “Save” to configure it in the future.
After you’re finished, just click on saved session and load. You will be asked to provide the username and the password.
You got the remote access to the shell and are able to do all tasks remotely.
If you are using the Mac OS, you may need some SSH client for Mac OS as well.
Using SFTP client
You need to download a SFTP client program Filezilla (client).
After installing and running it for the 1st time, you will get such interface:
You have to configure the connection similar like in Putty’s case.
After clicking on the button “New Site” and entering some name for it, you will have to:
- enter the IP address,
- the port number (if it is a default – 22);
- choose “Logon Type” – “Normal”
- enter the username and the password
Later, just click “Connect” and you will be connected to your server:
You are now ready to transfer the file to/from your server!