Thursday, April 29, 2021

ssh-key generate with passphrase


Check to see if ssh-key has passphrase is set up

New security implementaton force us to check if anyone is using their keys without passphrase. It was a big blow to our team. Some developers using windows as a base OS and some using linux as base os. On top of that the putty server session is saved using the key for all servers. so, for windows user, I had to generate key on their PC using puttygen and upload their public key to linux server and convert it to linux format. Finally append it to authorized_keys file.


check
$ sudo ssh-keygen -y -f /path/to/file

$ sudo find /usr/people/*/.ssh \( -name id\*a -a -o -name id\9 \) -exec echo "Checking: {}" \; -exec ssh-keygen -v -y -f {} \;

$ sudo find ~jay/.ssh \( -name id\*a -o -name id\*9 \) -exec ssh-keygen -P "" -u -f {} \;
$ find ./*/.ssh \( -name id\*a -o -name id\9) -exec ssh-keygen -y -f {} \;

Generate public and private key with passcode
$ sudo ssh-keygen -n [passphrase]

keep entering passphrase is not easy. Its a painful.
$ evel $(ssh-agent)
$ ssh-add ~sam/.ssh/id_rsa

No comments:

Post a Comment

Git branch show detached HEAD

  Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03)   00 2. Run re-set hard $ git reset --hard 3. ...