cheatsheets devlog projects search

Notes on SSH

2022-09-18 3

You can generate a public and private key easily.

# ssh-keygen.exe

This will prompt for a filename and will create 2 files, the private key and the public key. The public key will be

mv vscode_rsa ~/.ssh

Add a configuration to ~/.ssh/config.

    User nivethan
    ForwardAgent yes
    PreferredAuthentications publickey
    IdentityFile "C:\Users\nivethant\.ssh\vscode_rsa"

Now on the server, you need to add the public key to ~/.ssh/authorized_keys.

Copy the public key to the server and then run the command below.

cat >> ~/.ssh/authorized_keys

Now you can use ssh on the client machine and it will automatically connect using the keys.



If you get a permission denied issue, then it might be permissions on one of the folders is incorrect.

chmod 755 /home/nivethan
chmod 700 /home/nivethan/.ssh
chmod 600 /home/nivethan/.ssh/*