By default in Ubuntu SSH(Secure SHell) server is not installed. This is a big problem when you want to access the Ubuntu machines from other machines we can not access. In this post I will show you how to install and SSH server and give you some examples how to use ssh.
Installing ssh server in ubuntu
#apt-get install openssh-server
Once you install now try to login to that machine
#ssh 0
Note : In this example i am login to same machine, which i am going to check whether service is running or not. We should get successfully login for the above command which will prompt for password.
SSH examples:
Example1 : Login to a remote machine using it’s hostname
#ssh servername
Note : This will allow us to login to remote server on default ssh port(22)
Example2 : Login to a remote machine using it’s IP add
#ssh 192.168.0.1
Example3 : Login in to a remote machine which uses different port for running ssh server
#ssh 192.168.0.1 2010
Note : Here SSH server is running on 2010 port(some times this is good practice to secure the system).
Example4 : Login to a remote machine with different user
#ssh user@192.168.0.1
Example5 : Executing commands on remote machine without login to the machine.
#ssh 192.168.0.1 “ls -l”
Note : This command will execute “ls -l” command on remote host:192.168.0.1 and gives the output on a local machine.
SSH server is a big concept which can not be dealt with in one post. Will try to write another post on SSH server.