Setting Up SSh
Introduction
What is SSH, Why do we use it
Instillation
Commonly installed on computers by default (windows being slightly different).
Create a key
Prompted to enter a password, it's recommended for security but to leave it blank press enter.
ssh-keygen -t rsa -f ~/.ssh/ssh_key_name -C "comment"
Display the newly create public key.
cat ~/.ssh/ssh_key_name.pub
Copy public key to clipboard.
cat ~/.ssh/ssh_key_name.pub | pbcopy
Push public key direct to a server that has password login enabled.
cat ~/.ssh/ssh_key_name.pub | ssh -i ~/.ssh/ssh_key_name username@ip address 'cat >> .ssh/authorized_keys'
Additional Security
All managed via the sshd_config file.
sudo vim /etc/ssh/sshd_config
- Disable Root user access
- Disable password login
- Disable clear text passwords
- Change Port From 22
- Connection Time-out
- Restrict access to only allow access via permitted IP addresses
- SSH protocol version 2
Managing Server Access
SSH Aliases
vim ~/.ssh/config
Host name
User username
HostName ip address
IdentityFile directory eg. ~/.ssh/ssh_key_name
2 Factor-Authentication
15 minutes.
Tags
Development SSH Set Up