opened image

How to login to linux server via ssh

There are many ways to connect to a Linux server via SSH using different applications. Consider the methods of the classic version of connecting to the server using the login and password of the Linux user.
 

Connecting using PuTTY from the Windows operating system

Consider the easiest way - using the PuTTY program. To do this, you can download and install the program from the official website on the network. After installing and launching the application, enter the address of the server you want to log into.
 


The name myserver.com is given as an example. This is the domain name of the server or site that is located on the server. Instead, you can use the IP address of the server. Please note that port 22 is specified - this is the default port for connecting via SSH. When connecting for the first time, a window may appear:

 

 


If you press the Accept button, the system will remember the server by its fingerprint and the window will not appear on subsequent connections (only if you reinstall the OS on the server or select Connect Once. Or someone will pass off their server as yours, but the latter action is a serious violation of the rules of work in the Internet).

Next, you will see a terminal window asking you to enter a username and password. When entering a password, you will not see any characters on the screen. Enter the password blindly (or paste it using the SHIFT+INS combination). After that, there will be a welcome message, which may look like this (or maybe differently, depending on the server settings):

 

 

 

 


If a prompt appears like in the screenshot above, then you have successfully logged into the server via SSH and can enter commands on the server. Rectangles depict IP addresses from which the last connection attempts were made (unsuccessful and successful).

 

 

 

 

Connecting using the ssh command

If you are using Linux, MacOS, or some Windows systems, you can connect via SSH using the sshcommand line utility. In general, the command looks like this:

 

 

ssh [email protected]


Here:
user is the username. In most cases (and when working with Zomro servers) the username is root.
address.com - Internet accessible domain name or server IP address.

For example, let's connect to the server using the ssh command in Windows. When you connect for the first time, you will be prompted to add the server to the known ones. If someone impersonates their server as yours, then the connection will fail and an error will be returned with the message that someone is trying to impersonate their server as yours in order to steal data. Next, you need to enter a password. The characters will not be displayed on the screen. The password can also be pasted from the clipboard using keyboard shortcuts suitable for your system's command line program. For example, you can right-click in PowerShell on Windows or CTRL+SHIFT+V in a Linux terminal.

 

 


If you have reinstalled the operating system on the server and the sshprogram returns an error when connecting to the server saying that the server's fingerprint has changed, you need to remove this server from the known ones on your system and reconnect as for the first time. To do this, run the command:

 

 

ssh-keygen -R address.com


The command works wherever you can connect using the ssh program (Linux, Mac, Windows). Instead of address.com, enter the domain name or IP address of your server to which you want to connect.

 

 

Conclusion

Thus, ways to connect to a Linux server via SSH using a login and password were considered. In fact, there are a lot more programs with which you can connect via SSH. But they all use the same connection principle.