LinuxCommandLibrary

SSH

Connect to host

$ ssh [user]@[host]
copy

Run a command and exit

$ ssh [user]@[host] [command]
copy

X11 Session Forwarding

$ ssh -X [user]@[host]
copy

TCP Port Forwarding

$ ssh -L [localPort]:[host]:[port] [user]@[host]
copy

SOCKS5 proxying

$ ssh -D 9999 [user]@[host]
copy

End session

$ Ctrl+d
copy

Push file

$ scp [localFile] [user]@[host]:[remoteFile]
copy
$ rsync [localFile] [user]@[host]:[remoteFile]
copy

Pull file

$ scp [user]@[host]:[remoteFile] .
copy
$ rsync [user]@[host]:[remoteFile] .
copy

Connect with specific key

$ ssh -i [keyFile] [user]@[host]
copy

Push directory

$ scp -r [localDir] [user]@[host]:[remoteDir]
copy

Sync files

$ rsync -avz [localDir] [user]@[host]:[remoteDir]
copy

Interactive file transfer

$ sftp [user]@[host]
copy

Mount remote directory

$ sshfs [user]@[host]:[remoteDir] [localDir]
copy

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community