How to install ssh server and client in ubuntu
![]() |
How to install ssh in ubumtu |
What is "SSH"?
Check whether ssh client is installed
![]() |
verify ssh client is installed |
$ ssh
Just give this command to check whether the SSH client is installed. If it gives this kind of response that means SSH client is installed on your system.
Check ssh server is installed
To verify if ssh server is installed on your system. Just write "ssh localhost" which means you are trying to connect to your localhost.
$ ssh localhost
![]() |
verify ssh server is installed |
If it gives this kind of response which says "connection to host localhost port 22: connection refused" that means the OpenSSH server is not installed on your system.
For example, If you are working on your Windows operating system you want to access Ubuntu operating system by your terminal using "SSH" then you need to install OpenSSH.
check openssh server is running
To check whether the OpenSSH server is running. Just give this command "sudo service ssh status" and then press ENTER.
![]() |
ssh server is running |
$sudo service ssh status
If it gives this kind of response which says "active running" that means the OpenSSH server is running on your system.
Just say "yes" and then give your ubuntu password you are logged into your own operating system which is your ubuntu operating system.
Changing default port in ssh
If you want to change the default port on which ssh works, then you need to just change this port into a special file.
Just write this command,
$ sudo gedit /etc/ssh/sshd_config
![]() |
sshd_config file |
You can change it if you want to run this "openssh server" on some different ports.
Conclusion
In this way, you can log in to your Ubuntu operating system from a different Linux or UNIX or even Windows operating system using SSH client or SSH command.