Programming

SSH

What is SSH?

SSH means Secure Shell. Tatu Ylönen wrote the first version in 1995. Old Telnet carried the text in the open. SSH encrypts that path. Port 22 is usually used. You open it with a password or a key. A key has two parts: the secret part stays on your machine, and the public part is placed on the server. OpenSSH is the widely used program of this rule.

What is SSH used for?

SSH is for giving a command to a server, copying a file, and bringing a closed port to your own machine.

  • Updating a package on the server
  • Reading a log
  • A login without a password, by key
  • Copying a remote file to the local machine

What can you do with SSH?

Once you are inside with SSH, you are typing that computer's command. The text on your screen runs there. Copying a file is a separate command. SSH does not open a page to the internet. It is your login. Do not open root login to everyone.

Is SSH hard to learn?

Connecting once is easy. The difficulty is the key and the address. Do not put the secret part of the key on the server. It stays on your side. A wrong port or a wrong user can look like the same error. An old key warns you when the server changes. Do not skip that warning.

Advantages and limits

Advantage: the command and the password are not read on the path, and a key is easier to manage than a password. Limit: losing the secret part of the key can cut the login. SSH itself is not the firewall. The firewall says which port is open.

Basic ideas

The user says who is entering. The address says which machine it is. A key is the pair that stands in place of a password.

  • The port is usually 22
  • The public key stays on the server
  • The secret key stays with you
  • Telnet does not encrypt, SSH does

A short example

This command connects to the server as the named user. The command does not run there until the connection opens.

ssh user@server.example

Common questions

  • Are SSH and Bash the same? No. SSH carries the login. Bash is the command shell that can open inside.
  • Does the password travel in the open? Not in SSH. It would in Telnet. That is why Telnet is not used for login.
  • Do both parts of the key stay on the server? No. The secret part stays on your machine.