I can change the permissions of a file by:
chmod 600 ~/.ssh/authorized_keys
How can I retrieve the permissions of a file in the same format which is 600?
I can change the permissions of a file by:
chmod 600 ~/.ssh/authorized_keys
How can I retrieve the permissions of a file in the same format which is 600?
stat(1)
can show many file associated attributes by specifying special format strings to it's -c
option. In your case, use stat -c '%a' ~/.ssh/authorized_keys
to receive the same file mode in octal, 600
.
See it's manual page for a full list of supported format modifiers.
stat(1)
, but with different options.
– Satō Katsura
Jul 21 '16 at 15:58