Back to technologies

/ssh

SSH / SCP command reference

Secure remote workflow commands for servers, copies, and port forwarding.

12 matches

Connections

4 commands

ssh user@host

Connect to a remote host over SSH.

ssh -i ~/.ssh/key.pem user@host

Use a specific private key for authentication.

ssh -p 2222 user@host

Connect to a host using a custom SSH port.

ssh-copy-id user@host

Install your public key on a remote server.

File Transfer

5 commands

scp file.txt user@host:/path/

Copy a local file to a remote server.

scp -r ./project user@host:/var/www/

Recursively copy a folder to a remote host.

scp user@host:/path/file.txt ./

Download a remote file to the current directory.

sftp user@host

Start an interactive secure file transfer session.

rsync -avz ./dist/ user@host:/var/www/app/

Sync a local folder to a remote server efficiently.

Tunnels & Config

3 commands

ssh -L 5432:localhost:5432 user@host

Forward a local port to a remote service.

ssh -N -L 8080:localhost:80 user@host

Create a tunnel without opening a remote shell.

cat ~/.ssh/config

Inspect your local SSH client configuration.