Security
cancel
Showing results for 
Search instead for 
Did you mean: 

SSH Error : Authentication refused: bad ownership or modes for directory /

 
SOLVED
Go to solution
Highlighted
AntonyZEL
Occasional Contributor

SSH Error : Authentication refused: bad ownership or modes for directory /

Hello,

I want to connect on a server B with root user using ssh from a server A. I dont want to type password so I added the server A public key to the server B /.ssh/authorized_keys. 

It was working for several days, but since today, the server asks for password.

I've checked the syslog on server B (/var/adm/syslog/syslog.log) and there is : 

sshd[21007]: Authentication refused: bad ownership or modes for directory /

For me the directory or files attibutes ar correct :

# ll /
total 1314
drwx------ 2 root sys 8192 Jul 10 16:12 .ssh

# ll /.ssh
total 32
-rw------- 1 root sys 228 Jul 7 14:19 authorized_keys
-rw------- 1 root sys 3368 Jul 10 15:45 known_hosts

Can you tell me how can I see the "/" attributes (owner and mode) ? Why do I have this error ?

Thanks,

Regards,

Antony

 

 

 

 

 

4 REPLIES 4
Highlighted
Dennis Handly
Acclaimed Contributor

Re: SSH Error: Authentication refused: bad ownership or modes for directory /

> Can you tell me how can I see the "/" attributes?

 

By adding -d of course.

 

>Why do I have this error?

 

Have you tried "ssh -vvv" for more details?

Highlighted
AntonyZEL
Occasional Contributor
Solution

Re: SSH Error: Authentication refused: bad ownership or modes for directory /

Hello,

thanks you for your answer. 've change the "/" mode and it's working now :-)

ll -d /
drwxrwxrwx 36 root root 8192 Jul 11 03:20 /

chmod 755 /

ll -d /
drwxr-xr-x 36 root root 8192 Jul 11 03:20 /

Now it's ok !

Thansk,

Regards

 

Highlighted
Patrick Wallek
Honored Contributor

Re: SSH Error: Authentication refused: bad ownership or modes for directory /

You can turn off file and directory permission checks by setting the StrictModes parameter to no in the sshd_config file.

 

 

Highlighted
Matti_Kurkela
Honored Contributor

Re: SSH Error: Authentication refused: bad ownership or modes for directory /

Yes, you can... however having the system's root directory fully writable by everyone is generally a bad idea, so it's a good thing this authentication error caused it to be uncovered and fixed.

MK