I am logged in in my local PC (Fedora 24) as rperez. From this PC I needed to connect to a remote server through sshfs so I generated a private/public key by running ssh-keygen. Using the following command I am able to connect to the server without any problem:

sshfs rperez@server_ip:/home/rperez -p 2051 ~/dev -o auto_cache,reconnect

Now I have two Github account: one to be used from work, one to be used from home for personal projects. I would like to connect to both using SSH so I have setup the first one using the generated key for rperez and again that works fine.

I am trying to setup the second one (the personal) on the same PC so I did run this command:

ssh-keygen -t rsa -C "reynierpm@email.com" 

I have created the file ~/.ssh/config with the following content:

#rperez account
Host github.com-rperez
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa

#reypm account
Host github.com-reypm
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_reynierpm

Host <server_ip>
    IdentityFile ~/.ssh/id_dsa

And this is where my problem started. Now running the following commands:

sshfs rperez@server_ip:/home/rperez -p 2051 ~/dev -o auto_cache,reconnect
sshfs rperez@server_ip:/home/rperez -p 2051 ~/dev -o auto_cache,reconnect,IdentityFile=~/.ssh/id_rsa

Return this error:

read: Connection reset by peer

I should add, regardless the current problem, that I am not able to connect either to any Github repository

What is wrong with this configuration?

I have take some ideas from here but none is working for me. Also I am started from this guide for setup the Github accounts

Update: verbose output

ssh -vvv -p 2051 rperez@server_ip
OpenSSH_7.2p2, OpenSSL 1.0.2h-fips  3 May 2016
Bad owner or permissions on /home/rperez/.ssh/config
  • 1
    ssh -vvv rperez@server_ip – Jakuje Sep 27 '16 at 15:35
  • @Jakuje thank, this put me on the right direction fixing the permissions by running chmod 600 ~/.ssh/config make this work again. I'll not delete the post since maybe will be helpful for others – ReynierPM Sep 27 '16 at 15:40

Running the ssh in debug mode usually uncovers various problems. Usually permissions. In this case

Bad owner or permissions on /home/rperez/.ssh/config

means that the configuration file can not be writeable by others and therefore

chmod go-w /home/rperez/.ssh/config

should fix the problem for you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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