RishBlogs

SSH and Trickery

Introduction


The server must have SSHD server (Open SSH Daemon) — for listening to the requests

1
> ssh [username]@[IP Address]

Authentication Methods


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

Extras


1
2
> usermod -aG sudo [username]
-- For adding sudo permissions to the [username]
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


Resource