Tutorials

Sunday, July 22, 2018

Configure Remote Server Logins in Ubuntu

As software engineers some times we have to log in to the remote servers and have to do the configurations or some other things. As a Ubuntu lover I always do this using the terminal typing the below command.

ssh hostname@20.30.40.405

But it is hard to find the Hostname and IP of the server always. So I'm going to suggest a small configuration to make easy the remote server logins in Ubuntu.

Step 1 : Go to the home directory and open the terminal.

Step 2 : Create .ssh/config file there (Ex: Type view .ssh/config).

Step 3 : Add the following lines to config file (Ex: In vim editor press i and enter lines).

Host   myserver
User hostname
HostName 20.30.40.405

Above, Give any name for the host. It's the name for your remote login. Give the host name for the User and Server IP for the HostName.

Step 4 : Save & Close the config file (Ex: In vim editor press ctrl+c & then type :wq! to save and exit).

Step 5 : Type below command to login to the remote server.

ssh myserver (According to the above example)

Now you have to give the server password and you can log in to the remote server.

Like above you can configure many remote server logins in config file.