I have a use case where my program needs to read the id_rsa.pub
file under /root/.ssh
folder.
The default permissions for id_rsa.pub are (-rw-r--r--
) and for .ssh folder they are (drwx------
)
This is in line with the recommendations from the official SSH man page.
The problem:
Any group or a user cannot read the id_rsa.pub
file because the parent folder (.ssh) does not have the execute permission on a group or a user.
- What would be the point of having of such a permission combination? No user or group can read the
id_rsa.pub
file without proper permissions on.ssh
folder. - Will there be any concerns with changing permissions for
.ssh
folder from 700 to 710? (to enable my program to read theid_rsa.pub
file). This is also inline with the man page recommendations above.
.ssh/
aredrwx------
and theid_rsa.pub
has-rw-------
for the reasons you outline. No clue why you have theid_rsa.pub
set to-rw-r--r--
since it could never be read by others anyway in.ssh/
. Maybe you should clarify why you need a program that is not owned by you to have access toid_rsa.pub
in.ssh/
to begin with? That said,id_rsa.pub
is what one can share anywhere since it is the public key. My guess is it is just in.ssh/
for convenience. You should be able to just copy it to wherever you want for your application’s use..ssh/
directory whenid_rsa.pub
is the part of a key that can be publicly shared. It makes no sense to me unless a clear explanation can be provided as to why the application needs to behave this way./whatever
) and make symlinks anywhere (including/root/.ssh/
) I need.