Skip to main content

SSH

Create SSH Key​

  1. Youtube SSH Login in Ubuntu
  2. Github SSH reference
  3. SSH Based Auth
  4. GCP Ref
Generate SSH key

ssh-keygen -t rsa -f ~/.ssh/<ssh-file-name> -C <UserName> -b 2048

SSH Login with Key​

Debian OS​

SSH Login

ssh -i PATH_TO_PRIVATE_KEY USERNAME@EXTERNAL_IP

Known Issues​

Issue 1: UNPROTECTED PRIVATE KEY FILE​

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'sshuser' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "sshuser": bad permissions
sshuser@135.97.89.129: Permission denied (publickey).

Solution for Windows SSH Client​

Private key file should not have more than one user access. Removed other users from the property. Ref

  1. Right click the Key file first1.pem on explorer and Go to Properties > Security > Advanced > Disable Inheritance
  2. Select "Convert inherited permissions into explicit permissions on this object"
  3. Then delete everything there ( Including Administrator, User, User Groups ) and Click Add button.
  4. Now select select a principal > Advanced > Find Now > [ Your User object ] > OK
  5. Now you can tick "Full Control" then press OK

Now your key file is not accessible by others.

Issue 2:​