After doing as above, I always got this:
total 22
drwxrwxr-x+ 1 jl None 0 Sep 9 18:44 .
drwxrwxr-x+ 1 jl None 0 Sep 9 18:44 ..
-rw-rw---- 1 jl None 129 Jul 1 14:30 config
and the error on .ssh/config
. So I've run chown
on the .ssh
folder, and chmod
again like this:
> chown -R [USERNAME]:users .ssh/
and then:
> chmod -R 600 .ssh/
and finally I got it working:
total 29
drwxrwxr-x+ 1 jl None 0 Sep 9 18:44 .
drwxrwxrwt+ 1 jl None 0 Sep 9 18:44 ..
drw-------+ 1 jl Users 0 Sep 9 18:44 .ssh
Edit(for bash on Windows10)
When you get the error..
Failed to add the host to the list of known hosts (/PATH_TO_HOME/USERNAME/.ssh/known_hosts).
Make sure that known_hosts is writable
$ chmod 755 known_hosts
Note: I believe you only need to set 600 for your private key
Then, try to ssh.
When you get..
Permanently added 'HOST_IP' (RSA) to the list of known hosts.
You may replace mode 600
$ chmod 600 known_hosts
P.S.: I think this is a bug on Windows 8.
Have a look in /etc/group if you're unsure about the exact (localized) group name. – Luchs – 2014-06-19T20:52:20.780
1Thanks this worked for me as well, in German you need to use
chown -R [Username]:Benutzer .ssh/
– con – 2014-09-08T17:23:07.080It's not just windows 8. It happened for me (win7) after modifying the config file using my sublimeText editor, which apparently saves the file using its own permissions. The above solution fixed the problem – xShirase – 2014-11-28T19:23:50.927
The accepted answer didn't work for me, but this did. Thanks! – Achal Dave – 2013-09-12T03:54:28.830
Also, this is quite a weird bug. On my computer (W8.1), editing the .ssh/config file in Vim always leads to this bug. It's extremely annoying, as every change to my ssh config requires running these commands. – Achal Dave – 2013-10-22T18:14:50.583
4And just to add to the weirdness, if you're using an non English version of Windows then make sure to use the locale translation of "users" when issuing this command. For example in Dutch it becomes "chown -R :Gebruikers .ssh" – Alexander Kellett – 2014-01-13T10:27:04.630
1For me, this worked:
chown -R m0j0:Users .ssh && chmod -R go-rwx .ssh – m0j0 – 2014-01-23T14:40:52.047
Tried changing the group on just .ssh/config, but it didn't work until I first changed the group on the .ssh directory itself. Thanks! – Paul Brannan – 2014-03-27T16:20:57.933