Skip to content

This page contains help on SSH setup in Linux

Command to create ssh key (public and private) and store it in .ssh directory in user's home directory

ssh-keygen

Command to copy the public ssh key to remote ssh server for remote access

cat <public_key_file> | ssh <user>@<server_ip> "cat >> ~/.ssh/authorized_keys"

Command to connect to remote server using SSH

ssh user@server_ip_or_domain

Command to add a private key to ssh-agent

ssh-add <path-to-private-key-file>