Last Updated on 14/11/2020
This tutorial will show you how to open SSH connection on Linux directly on the console, so you don’t need to rely on third party software like Putty.
I’ve seen quite a few people relying on a Putty installation on Ubuntu and/or CentOS to access a remote server through SSH, but despite how good I think Putty is, its usage is far from necessary when you are on a Linux environment.
A Basic SSH
In order to SSH to a remote host or IP using the same username as the current one you are logged in, simply do the following:
# Using the hostname ssh myserver.bgasparotto.com # Using the IP ssh 10.20.30.40
After the commands above are ran, you will probably be prompted to type the user’s password.
Specifying an username
It’s most likely that you would need to specify a different username to log into your remote host, so for an username called admin
, do the following:
ssh admin@myserver.bgasparotto.com
Using a different port than 22
The ssh
command attempts to connect to the port 22
by default, if you need to connect to a different port like 2222
, pass the -p parameter:
ssh -p 2222 admin@myserver.bgasparotto.com
Logging out
When you are done with the remote server, just type the command below to quit:
exit
Hope it helps. Cya!