ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
ssh-add ~/.ssh/github_rsa | |
ssh-add ~/.ssh/mozilla_rsa |
chmod 700 ~/.ssh | |
chmod 644 ~/.ssh/authorized_keys | |
chmod 644 ~/.ssh/known_hosts | |
chmod 644 ~/.ssh/config | |
chmod 600 ~/.ssh/id_rsa | |
chmod 644 ~/.ssh/id_rsa.pub | |
chmod 600 ~/.ssh/github_rsa | |
chmod 644 ~/.ssh/github_rsa.pub | |
chmod 600 ~/.ssh/mozilla_rsa | |
chmod 644 ~/.ssh/mozilla_rsa.pub |
This comment has been minimized.
This comment has been minimized.
Thank |
This comment has been minimized.
This comment has been minimized.
is that ok to have: chmod 644 ~/.ssh/id_rsa? (private key) |
This comment has been minimized.
This comment has been minimized.
@Emilio66 no, otherwise |
This comment has been minimized.
This comment has been minimized.
Thank you so much for this! |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
This is very handy. Thanks! |
This comment has been minimized.
This comment has been minimized.
Thank you for this! |
This comment has been minimized.
This comment has been minimized.
Thank you! I aways forget the permissions... |
This comment has been minimized.
This comment has been minimized.
Thanks for sharing. I used these and quickly resolved an issue :) |
This comment has been minimized.
This comment has been minimized.
Should chmod 644 ~/.ssh/authorized_keys be chmod 600? |
This comment has been minimized.
This comment has been minimized.
Exactly what I was looking for, thank you! |
This comment has been minimized.
This comment has been minimized.
Something that has always mystified me... If ~/.ssh is set to So... I was about to follow suit here, and then remembered that there is always
Based on this excerpt, it is required that the .ssh directory be Thus:
Should be all you need. |
This comment has been minimized.
This comment has been minimized.
Well, while this is probably a valid configuration for your user, you'll soon run into problems if your public-key files are not readable by applications and processes that possibly / often run in a different user context e.g. as a different "user" internally in the OS and needs to access your public keys for things like signing and / or verifying files using ssh. The original gist has the most common and flexible enough permission setup, and is the way most systems, programmers and software expect the permissions to be set. |
This comment has been minimized.
This comment has been minimized.
This certainly helped @grenade. Thanks! |
This comment has been minimized.
This comment has been minimized.
thanks. saved me before the holiday ;-) |
This comment has been minimized.
This comment has been minimized.
Got the gist of it |
This comment has been minimized.
This comment has been minimized.
Bravo, nice gist! |
This comment has been minimized.
This comment has been minimized.
I think maybe add this I met a lot of users, type command like this |
This comment has been minimized.
This comment has been minimized.
Thanks, this helped! |
This comment has been minimized.
This comment has been minimized.
Surely you must have meant?
|
This comment has been minimized.
This comment has been minimized.
thanks |
This comment has been minimized.
This comment has been minimized.
Thank you ,this helps me! |
This comment has been minimized.
This comment has been minimized.
A great time saver on every new env setup I have |
This comment has been minimized.
This comment has been minimized.
OMG after a weekend trying to work this out, you're a lifesaver @grenade!! I was holding my breath but hey, flawless code. Cheers! |
This comment has been minimized.
This comment has been minimized.
Don't forget the home directory! |
This comment has been minimized.
This comment has been minimized.
755 for the home directory /home/USER ? Y or N ? For .SSH Folder :cd ~/ For .SSH Filescd ~/.ssh/ |
This comment has been minimized.
This comment has been minimized.
That should be |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
Thanks a lot |
This comment has been minimized.
This comment has been minimized.
Thanks :) |
This comment has been minimized.
This comment has been minimized.
consider to add this chmod g-w,o-w /home/$USER
or
chmod g-w,o-w ~/ |
This comment has been minimized.
This comment has been minimized.
This is a great trick, always going back here to remember and to fix ssh permissions; |
This comment has been minimized.
This comment has been minimized.
Thank you |
This comment has been minimized.
This comment has been minimized.
Thank you so much for this gist man, amazing. |
This comment has been minimized.
This comment has been minimized.
Thanks for those simple but important commands. It saved me from craziness :) |
This comment has been minimized.
This comment has been minimized.
Beware that the man pages will vary from one version to another. For example, the man page on Ubuntu Bionic says:
Which would mean either Overall, safer is better and you should lock the files down as much as possible for your environment. |
This comment has been minimized.
This comment has been minimized.
Works like a charm. Thanks dude! |
This comment has been minimized.
Thanks man, it helped