GO KALI FREE
Remote Access Commands

ssh Linux Command

Connects securely to a remote machine via the SSH protocol.

What does ssh do?

Connects securely to a remote machine via the SSH protocol.

Syntax

ssh [options] user@host

Practical example

ssh -p 2222 kali@192.168.1.100

Questions about ssh

How do I connect to a remote server with SSH?

Use `ssh username@hostname` to connect. For example, `ssh user@192.168.1.100` connects to that IP address.

How do I connect on a non-standard port?

Use `ssh -p 2222 user@host` to connect on port 2222 instead of the default port 22.

How do I set up passwordless SSH login?

Generate keys with `ssh-keygen`, then copy to server with `ssh-copy-id user@host`. After that, SSH will use key authentication automatically.

How do I run a command on a remote server?

Use `ssh user@host 'command'` to execute a command on the remote server and return the output.

How do I debug SSH connection issues?

Use `ssh -vvv user@host` for verbose debug output. This shows each step of the connection process.

How do I change the SSH port on the server?

Edit /etc/ssh/sshd_config and change the Port line. Then restart SSH with `sudo systemctl restart ssh`.

How do I forward a local port to a remote server?

Use `ssh -L 8080:localhost:80 user@host` to forward local port 8080 to port 80 on the remote server.

How do I connect without checking the host key?

Use `ssh -o StrictHostKeyChecking=no user@host`. Only use this for testing; it disables host key verification.

Related Remote Access Commands

ssh-copy-id

Copies your SSH public key to a remote server for key-based authentication.

scp

Securely copies files between local and remote hosts over SSH.

ssh-keygen

Generates SSH public/private key pairs for passwordless authentication.

rsync

Efficiently syncs files and directories between two locations (local or remote).

telnet

Connects to a remote host via the Telnet protocol (unencrypted — prefer SSH).

ftp

Transfers files to and from a remote host using the File Transfer Protocol.