1

I am getting following error since last few days.

   Using username "centos".
   Server refused our key
   [email protected]'s password:

It appeared after I changed permission of /home/centos since I wanted to view some files inside home/centos/.local folder.

Current permissions are :

/home/centos -> 755

/home/centos -> 777

/home/centos/.ssh -> 777

I visited this link, it says that -

The procedure doesn't correct the issue if permissions to the home directory are broken. You must manually correct the home directory permissions

So I want to know How can I fix these permissions manually?

I am not able to change permissions using FileZilla and I am not able to login over instance using Putty.

Please suggest.

2 Answers 2

2

Your problem was related to .ssh

If this directory containing your personal key, is read AND writeable to anyone else then the user, the system sees this as a security breach and ssh stops working.

Always make sure that, the folder has chmod 700

Always make sure that your personal *.key is only readable by the user.

Here this is what it should look like

The folder has a chmod 700, the private key id_rsa a 600, public key and known_hosts has a 644

drwx------   5 s1mmel  staff   160B Dec 11 15:24 .
drwx------+ 46 s1mmel  staff   1.4K Jan 22 11:53 ..
-rw-------   1 s1mmel  staff   3.3K Dec 11 15:15 id_rsa
-rw-r--r--   1 s1mmel  staff   745B Dec 11 15:15 id_rsa.pub
-rw-r--r--   1 s1mmel  staff   889B Jan 16 18:20 known_hosts
0

I am new linux learner and I learned a lot after this issue came.

Since permissions of /centos and /.ssh directory was broken so I had to fix those. Permission of /centos & /.ssh directory should be 700.

I followed below link to change the permission manually.

Access secondary EBS volume and change permission of /.ssh directory - AWS

Detached the Volume and attached it back to the original instance. Installed firewalld, enabled port 80 & 443, started Apache.

Now website is working fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .