Fixing bad owner or permissions on SSH config file
Recently I was trying to connect to an ssh server and received the following error:
Bad owner or permissions on ~/.ssh/config
Navigating to the folder ~/.ssh/
and checking the permissions of the file (ls -la config
) shows the following:
$ ls -la config
-rw-rw-rw- 1 1000 1000 1390 Jul 31 22:08 config
The issue is either bad owner or bad permissions.
Bad permission
In our case above we have the wrong permissions, this can be fixed by running the following command:
chmod 644 config
Checking the permissions again gives us the following result:
$ ls -la config
-rw-r--r-- 1 1000 1000 1390 Jul 31 22:08 config
Bad owner
In our case above also we have a bad owner, this can be fixed by running the following command:
chown root:root config
Checking the permissions again gives us the following result:
$ ls -la config
-rw-r--r-- 1 root root 1390 Jul 31 22:08 config
Note: I have set the permission to the user root
above, change username as required.