dolmen / github-keygen

Easy creation of secure SSH configuration for your GitHub account(s)
GNU General Public License v3.0
246 stars 25 forks source link

Ensure correct permissions for ~/.ssh/config #32

Closed rikusilvola closed 7 years ago

rikusilvola commented 7 years ago

This patch automates setting the correct file permissions of the ssh client configuration file, which might otherwise be too permissive, should it already exist.

rikusilvola commented 7 years ago

I see I've mistakenly created this PR to release branch. Would you like me to cancel this and make another for the master branch?

dolmen commented 7 years ago

Yes. Make a new PR based on the master branch. And a better fix would be to set umask before file creation.

rikusilvola commented 7 years ago

@dolmen, that is the case already if the filed doesn't exist. This bug only occurs when the config file exists, and has incorrect permissions, thus requiring changing them.

dolmen commented 7 years ago

Do you mean that github-keygen should fix a bug introduced by someone else (may be the user himself)? I disagree. Or maybe the user really wants other permissions than 0600 (for example to share the config with multiple users of the same group) and github-keygen would break that. I do not see any valid reason to be stricter about permissions on ~/.ssh/config than ssh itself (which allows mode 0660 for example).