Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have MASTER key under user alexus, yet whenever trying to ssh as root and/or other users on the box via sudo and getting error Bad owner or permissions on /root/.ssh/config

[root@wcmisdlin02 ~]# ls -ld .ssh
lrwxrwxrwx. 1 root root 17 May 14 13:00 .ssh -> /home/alexus/.ssh
[root@wcmisdlin02 ~]# ll .ssh/config 
-rw-------. 1 alexus alexus 215 Feb  4 12:47 .ssh/config
[root@wcmisdlin02 ~]# ssh XXXXX
Bad owner or permissions on /root/.ssh/config
[root@wcmisdlin02 ~]# 

This was working before, I recently rebuild my system and trying to get this to work and can't figure out what's missing(

[root@wcmisdlin02 ~]# getenforce 
[root@wcmisdlin02 ~]# 

Please advise.

share|improve this question

You have used symlinks so that /root/.ssh is a symlink to /home/alexus/.ssh. Ssh is not going to like that, because it gives alexus write access to .ssh/config and all the other .ssh/* files.

You need to remove the symlink, copy the files into root's directory, and change the ownership of all of it to root. If you're doing the symlink stuff so that root and alexus share a keypair, you may be able to symlink just the id_* files into /root/.ssh/.

Something like this:

rm /root/.ssh
mkdir /root/.ssh
cp /home/alexus/.ssh/* /root/.ssh/
chown -R root /root/.ssh
rm /root/.ssh/id_*
ln -s /home/alexus/.ssh/id_* /root/.ssh/
share|improve this answer
Note that this solution requires modifying the default permissions on the /root directory so that the user alexus can read those files. Not sure, but probably setting StricModes to no in /etc/ssh/sshd_config would be needed as well. – dawud May 14 '13 at 18:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.