Introduction
- Protocol to communicate with other nodes (secure shell)
- Other examples of protocol are HTTP, HTTPS, FTP, … (each one have some port of their own) like 22 for SSH, 21 for FTP
- Traffic is encrypted <3
The server must have SSHD server (Open SSH Daemon) — for listening to the requests
1
| > ssh [username]@[IP Address]
|
Authentication Methods
- Password
- SSH keys — can be used with git
- Host
Generate SSH key & Commands
1
2
3
4
5
6
7
| > ssh-keygen [-T rsa]
~/.ssh/id_[rsa/something].pub -> Public Key
> ssh-add [path_to_file]
~/.ssh/authorized_keys -> file for adding public keys on server
|
After generating keys, they can be uploaded to the server so as to get authorized access without traditional username-password pair.
Note For GitHub SSH
Update the .ssh/config file by adding the following code for connecting to github after configuring SSH keys
1
2
3
| Host github.com
Hostname ssh.github.com
Port 443
|
To check if the steps were successful, try the following code
1
| $ ssh -T git@github.com
|
1
2
| > usermod -aG sudo [username]
-- For adding sudo permissions to the [username]
|
- PORT — 22 can be seen in the config file sshd_config
1
2
3
4
5
| > sudo vim /etc/ssh/sshd_config
-- SSH config file
> sudo systemctl reload sshd
-- After updating --
|
1
| > sudo chown [Do Not Include~"change owner"] -R [user]:[group] [path to directory]
|
Queries
- SCP? — secure file copy, drag and drop file to suvey?
- For copying files across local and server
Resource