ssh
Audited by Runlayer on Mar 3, 2026
Malicious tool definition detected
EOF chmod 600 ~/.ssh/config ``` Then connect using the alias: ```bash ssh alias ``` ## Common SSH Options - `-p PORT`: Connect to a specific port - `-X`: Enable X11 forwarding - `-L local_port:remote_host:remote_port`: Set up local port forwarding - `-R remote_port:local_host:local_port`: Set up remote port forwarding - `-N`: Do not execute a remote command (useful for port forwarding) - `-f`: Run in background - `-v`: Verbose mode (add more v's for increased verbosity) ## File Transfer with SCP
Malicious tool definition detected
### Key-Based Authentication Generate a new SSH key pair: ```bash ssh-keygen -t ed25519 -f ~/.ssh/key_name -C "comment" -N "" ``` Copy the public key to the remote server: ```bash ssh-copy-id -i ~/.ssh/key_name.pub username@hostname ``` Connect using the private key: ```bash ssh -i ~/.ssh/key_name username@hostname ``` ## SSH Configuration Create or edit the SSH config file for easier connections: ```bash mkdir -p ~/.ssh cat > ~/.ssh/config << 'EOF' Host alias HostName hostname_or_ip User userna