SSH

Recipes

  • Connect to host:

ssh -A username@server

-A enables forwarding of the authentication agent connection. In other words you can connect to another ssh server from current ssh server

  • Mount folder on host with sshfs:

sshfs username@server:/path-on-server/ ~/path-to-mount-point -o reconnect
  • Copy over SSH (actually the best way is mounting with sshfs):

# from local to remote
scp file.txt username@server:/path-on-server/

# from remote to local
scp username@server:/path-on-server/file.txt  file.txt

# copy all files and folders recursively from local to remote
scp -r * username@server:/path-on-server/
  • Add your SSH key to the ssh-agent:

ssh-add ~/path-to-key

Last updated