SSH - Secure Shell
Intro
My notes on SSH tools
Generate Public + Private Keys for SSH
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
The private key (which you must keep secret) will be written to ~/.ssh/id_rsa
. Your public key, which can be shared, will be stored in ~/.ssh/id_rsa.pub
.
You must then copy the public key to the servers you intend to login via SSH.
ssh-copy-id <username>@<server hostname>
You can also copy the id_rsa.pub
directly to the server and then append it to the authorized_keys
files. The authorized keys are by default configured in .ssh/authorized_keys
in the user's home directory
Other Resources
SSH’s documentation: Generate a New SSH Key, Authorized_keys File in SSH, Configuring Authorized Keys for OpenSSH
SSH Academy has good information on SSH and IAM: SSH Academy
SSH Terminals
CygWin has SSH built in.
Putty
MobaXterm - my favorite, includes secure copy to move files between Windows and Linux
Windows Subsystem for Linux comes with SSH preinstalled.
SSH Academy’s Best free SSH clients for Windows
Commands
Login to remote computer.
ssh -p <optional port number> <username>@<remote hostname>
Specify the identity (private key file) with the -i
ssh -i sshkey.private bandit14@localhost
Copy file to remote computer
scp localfile.txt <username>@<remote hostname>:<path in remote file system>
SSH Scanners
Qualys has an SSH scanning tool to detect access with common passwords