Basic SSH Commands That You Should Know About - Blog - tinybit

Basic SSH Commands That You Should Know About

Created on 26 January, 2023Technolgy • 525 views • 1 minutes read

Basic SSH Commands That You Should Know About

  1. ssh: Connect to a remote server using the SSH protocol. Syntax: ssh [username]@[hostname or IP address]
  2. scp: Copy files between a local and a remote server using the SSH protocol. Syntax: scp [file] [username]@[hostname or IP address]:[path]
  3. ssh-keygen: Generate a new SSH key pair for secure authentication. Syntax: ssh-keygen -t [type of key] -b [key size] -C [comment]
  4. ssh-copy-id: Add a public key to the authorized keys on a remote server, allowing for passwordless authentication. Syntax: ssh-copy-id [username]@[hostname or IP address]
  5. sftp: Connect to a remote server and transfer files using the SFTP protocol. Syntax: sftp [username]@[hostname or IP address]
  6. ssh-add: Add a private key to the SSH authentication agent, allowing for passwordless authentication. Syntax: ssh-add [path to private key]
  7. ssh-agent: Start the SSH authentication agent, which manages private keys for passwordless authentication. Syntax: ssh-agent
  8. ssh-keyscan: Add a remote server's host key to the known hosts file, allowing for secure connections to that server. Syntax: ssh-keyscan [hostname or IP address]
  9. exit: Close the SSH connection and exit the remote terminal. Syntax: exit
  10. logout: Close the SSH connection and exit the remote terminal. Syntax: logout



Please note that these are basic commands and there are many other commands and options that can be used with SSH.