<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: connection reset by peer &#8212; ssh sshfs error</title>
	<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/</link>
	<description>Diary of my Linux journeys. Everything Linux by Kamil Wójcicki</description>
	<pubDate>Thu, 09 Feb 2012 21:35:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Doug H</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1597</link>
		<author>Doug H</author>
		<pubDate>Sun, 20 Nov 2011 07:09:30 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1597</guid>
		<description>Thanks to bingo!

I had old *root* ssh key in /root/.ssh/known_hosts and had reinstalled server OS. Deleted the server's line in that file and was fine.

It was confusing as:
1) I got the "Connection refused" message when doing sudo sshfs....
2) ssh from prompt (no sudo) was fine</description>
		<content:encoded><![CDATA[<p>Thanks to bingo!</p>
<p>I had old *root* ssh key in /root/.ssh/known_hosts and had reinstalled server OS. Deleted the server&#039;s line in that file and was fine.</p>
<p>It was confusing as:<br />
1) I got the &#034;Connection refused&#034; message when doing sudo sshfs&#8230;.<br />
2) ssh from prompt (no sudo) was fine</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1547</link>
		<author>Tommy</author>
		<pubDate>Sat, 24 Sep 2011 08:10:11 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1547</guid>
		<description>If you have this problem when you try to sshfs to a Synology NAS you may find a solution description here:

http://www.mmncs.com/2011/07/setup-openssh-sftp-server-on-synology-nas-and-connect-using-sshfs-from-your-linux-ubuntu-web-server/

The Synology NAS does not have openssh-sftp-server installed by default. openssh-sftp-server is required to make a sshfs mount.</description>
		<content:encoded><![CDATA[<p>If you have this problem when you try to sshfs to a Synology NAS you may find a solution description here:</p>
<p><a href="http://www.mmncs.com/2011/07/setup-openssh-sftp-server-on-synology-nas-and-connect-using-sshfs-from-your-linux-ubuntu-web-server/" rel="nofollow">http://www.mmncs.com/2011/07/setup-openssh-sftp-server-on-synology-nas-and-connect-using-sshfs-from-your-linux-ubuntu-web-server/</a></p>
<p>The Synology NAS does not have openssh-sftp-server installed by default. openssh-sftp-server is required to make a sshfs mount.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Durand</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1530</link>
		<author>Durand</author>
		<pubDate>Mon, 08 Aug 2011 09:34:46 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1530</guid>
		<description>Ahhh, thank you so much!</description>
		<content:encoded><![CDATA[<p>Ahhh, thank you so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1137</link>
		<author>Kevin</author>
		<pubDate>Fri, 02 Jul 2010 20:21:22 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-1137</guid>
		<description>I'm a bit late to the game, but thanks from me as well for posting the issue with an out-of-date known_hosts file on root! Once I saw that, I knew that was it. Too bad I already scp'ed everything, but well...now I know and will never forget :)</description>
		<content:encoded><![CDATA[<p>I&#039;m a bit late to the game, but thanks from me as well for posting the issue with an out-of-date known_hosts file on root! Once I saw that, I knew that was it. Too bad I already scp&#039;ed everything, but well&#8230;now I know and will never forget <img src='http://linux.dsplabs.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-605</link>
		<author>Chris</author>
		<pubDate>Thu, 22 Jan 2009 11:10:18 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-605</guid>
		<description>One of the best written and structured helps that I have read.  I particularly like the use of 'sed'.  My only gotcha was that I needed to clean out the root's known_host file since I was using 'sudo'.  I've only been using 'sudo' for a few months so I didn't think about the implications.  Bingo, many thanks for posting your resolution so that I only lost 10 minutes!</description>
		<content:encoded><![CDATA[<p>One of the best written and structured helps that I have read.  I particularly like the use of &#039;sed&#039;.  My only gotcha was that I needed to clean out the root&#039;s known_host file since I was using &#039;sudo&#039;.  I&#039;ve only been using &#039;sudo&#039; for a few months so I didn&#039;t think about the implications.  Bingo, many thanks for posting your resolution so that I only lost 10 minutes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bingo</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-595</link>
		<author>bingo</author>
		<pubDate>Fri, 02 Jan 2009 18:11:06 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-595</guid>
		<description>OK.  My problem was because I was using sudo to mount and so _root_ had the old key.  So I had to edit the /root/.ssh/known_hosts file to remove the line.  That took awhile to figure out :)

#/bin/bash
echo "${1}"
if [ ! -d /home/${USER}/mnt/${1} ]; then
	mkdir -p /home/${USER}/mnt/${1}
fi
sudo sshfs ${USER}@${1}: /home/${USER}/mnt/${1} -C -o allow_other</description>
		<content:encoded><![CDATA[<p>OK.  My problem was because I was using sudo to mount and so _root_ had the old key.  So I had to edit the /root/.ssh/known_hosts file to remove the line.  That took awhile to figure out <img src='http://linux.dsplabs.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>#/bin/bash<br />
echo &#034;${1}&#034;<br />
if [ ! -d /home/${USER}/mnt/${1} ]; then<br />
	mkdir -p /home/${USER}/mnt/${1}<br />
fi<br />
sudo sshfs ${USER}@${1}: /home/${USER}/mnt/${1} -C -o allow_other</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tjh</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-555</link>
		<author>tjh</author>
		<pubDate>Mon, 27 Oct 2008 09:14:50 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-555</guid>
		<description>Thank you very much, this was exactly what I needed,
thought I did not have the 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

I did have the 'read: Connection reset by peer' and everything worked fine.</description>
		<content:encoded><![CDATA[<p>Thank you very much, this was exactly what I needed,<br />
thought I did not have the </p>
<p>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br />
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @<br />
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br />
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!</p>
<p>I did have the &#039;read: Connection reset by peer&#039; and everything worked fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-291</link>
		<author>matt</author>
		<pubDate>Mon, 30 Jun 2008 08:12:59 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-291</guid>
		<description>For anyone having trouble using keys with names, like me using multiple keys for multiple machines, here's  a tip. Say this is your key, and your machine only accepts keys, no passwords.

/home/user/.ssh/privatekey

If you try to login using the normal "-i" ssh option, you'll get the infamous "Connection reset by peer," and with debug it will show "Permission denied (publickey)."

(WRONG)     sshfs -p 2222 -i /home/user/.ssh/privatekey user@HOST:/docs /home/docs

Instead you will need to use the "-o IdentityFile=" option (see man ssh_config):

(CORRECT)  sshfs -p 2222 -o IdentityFile=/home/user/.ssh/privatekey user@HOST:/docs /home/docs

So while the "-o" option works, the "-i" option doesn't. Strange. Perhaps this will change in future versions.</description>
		<content:encoded><![CDATA[<p>For anyone having trouble using keys with names, like me using multiple keys for multiple machines, here&#039;s  a tip. Say this is your key, and your machine only accepts keys, no passwords.</p>
<p>/home/user/.ssh/privatekey</p>
<p>If you try to login using the normal &#034;-i&#034; ssh option, you&#039;ll get the infamous &#034;Connection reset by peer,&#034; and with debug it will show &#034;Permission denied (publickey).&#034;</p>
<p>(WRONG)     sshfs -p 2222 -i /home/user/.ssh/privatekey <a href="mailto:user@HOST:/docs">user@HOST:/docs</a> /home/docs</p>
<p>Instead you will need to use the &#034;-o IdentityFile=&#034; option (see man ssh_config):</p>
<p>(CORRECT)  sshfs -p 2222 -o IdentityFile=/home/user/.ssh/privatekey <a href="mailto:user@HOST:/docs">user@HOST:/docs</a> /home/docs</p>
<p>So while the &#034;-o&#034; option works, the &#034;-i&#034; option doesn&#039;t. Strange. Perhaps this will change in future versions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-285</link>
		<author>misko</author>
		<pubDate>Wed, 18 Jun 2008 20:00:36 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-285</guid>
		<description>I had same problem "Connection reset by peer" but it was nothing mention before...

Problem was stupid...

My hosting use notdefault port for ssh so in
sshfs  ${ssh_username}@${ssh_server}: ${mount_point}
I had to change to
sshfs -p 23345 ${ssh_username}@${ssh_server}: ${mount_point}

I hope this will help someone...</description>
		<content:encoded><![CDATA[<p>I had same problem &#034;Connection reset by peer&#034; but it was nothing mention before&#8230;</p>
<p>Problem was stupid&#8230;</p>
<p>My hosting use notdefault port for ssh so in<br />
sshfs  ${ssh_username}@${ssh_server}: ${mount_point}<br />
I had to change to<br />
sshfs -p 23345 ${ssh_username}@${ssh_server}: ${mount_point}</p>
<p>I hope this will help someone&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azulus</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-263</link>
		<author>Azulus</author>
		<pubDate>Sun, 04 May 2008 01:20:59 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-263</guid>
		<description>I was having the connection reset by peer issue and as I was tailing auth.log on the ssh-server I saw the following:

May  3 18:22:27 ub3r sshd[19954]: subsystem request for sftp
May  3 18:22:27 ub3r sshd[19954]: subsystem request for sftp failed, subsystem not found

After that happened on the server I'd receive the connection reset error locally. In the server's /etc/ssh/sshd_config, near the bottom there was an sftp subsystem line commented out.  I uncommented it and restarted my SSH server and everything seems to work fine now.</description>
		<content:encoded><![CDATA[<p>I was having the connection reset by peer issue and as I was tailing auth.log on the ssh-server I saw the following:</p>
<p>May  3 18:22:27 ub3r sshd[19954]: subsystem request for sftp<br />
May  3 18:22:27 ub3r sshd[19954]: subsystem request for sftp failed, subsystem not found</p>
<p>After that happened on the server I&#039;d receive the connection reset error locally. In the server&#039;s /etc/ssh/sshd_config, near the bottom there was an sftp subsystem line commented out.  I uncommented it and restarted my SSH server and everything seems to work fine now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kamil</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-255</link>
		<author>Kamil</author>
		<pubDate>Tue, 22 Apr 2008 01:59:46 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-255</guid>
		<description>good point, ssh server is not installed by default on Ubuntu, thanks Woland</description>
		<content:encoded><![CDATA[<p>good point, ssh server is not installed by default on Ubuntu, thanks Woland</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Woland</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-253</link>
		<author>Woland</author>
		<pubDate>Mon, 21 Apr 2008 11:08:44 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-253</guid>
		<description>Hi!

I was just having the same problem,and I was scratching my head as your howto didn't help either. Then suddenly I remembered forgetting to install openssh-server on the server side. :))) Hehe, really simple solution!  
BTW, thanks for the howto!
Woland</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>I was just having the same problem,and I was scratching my head as your howto didn&#039;t help either. Then suddenly I remembered forgetting to install openssh-server on the server side. :))) Hehe, really simple solution!<br />
BTW, thanks for the howto!<br />
Woland</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spirit</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-252</link>
		<author>spirit</author>
		<pubDate>Fri, 18 Apr 2008 18:07:10 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-252</guid>
		<description>Clear and perfect
many thanks</description>
		<content:encoded><![CDATA[<p>Clear and perfect<br />
many thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kamil</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-226</link>
		<author>Kamil</author>
		<pubDate>Thu, 27 Mar 2008 03:20:50 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-226</guid>
		<description>The verbose mode of ssh (&lt;b&gt;ssh -v&lt;/b&gt;) gives lots of useful debug info.

From the sshfs man page:
&lt;i&gt;   -o sshfs_debug
              print some debugging information&lt;/i&gt;

On a successful mount it does not print much info:
&lt;i&gt;kamil@kw32:~$ sshfs -o sshfs_debug kamil@rec:/ /mnt/rec
kamil@rec's password: 
Server version: 3
kamil@kw32:~$&lt;/i&gt;

Hopefully it spits out more debug for you.</description>
		<content:encoded><![CDATA[<p>The verbose mode of ssh (<b>ssh -v</b>) gives lots of useful debug info.</p>
<p>From the sshfs man page:<br />
<i>   -o sshfs_debug<br />
              print some debugging information</i></p>
<p>On a successful mount it does not print much info:<br />
<i><a href="mailto:kamil@kw32:~$">kamil@kw32:~$</a> sshfs -o sshfs_debug <a href="mailto:kamil@rec:/">kamil@rec:/</a> /mnt/rec<br />
<a href="mailto:kamil@rec's">kamil@rec&#039;s</a> password:<br />
Server version: 3<br />
<a href="mailto:kamil@kw32:~$">kamil@kw32:~$</a></i></p>
<p>Hopefully it spits out more debug for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ubuntu For Free</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-225</link>
		<author>Ubuntu For Free</author>
		<pubDate>Wed, 26 Mar 2008 23:14:54 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-225</guid>
		<description>I'm having no problems with ssh into the box, but I do get the reset by peer error. My keys should all be the same. Is there some kind of a log file I can check to get more specific information</description>
		<content:encoded><![CDATA[<p>I&#039;m having no problems with ssh into the box, but I do get the reset by peer error. My keys should all be the same. Is there some kind of a log file I can check to get more specific information</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kamil</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-186</link>
		<author>Kamil</author>
		<pubDate>Mon, 25 Feb 2008 05:21:19 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-186</guid>
		<description>Hmm, it is rather tough to fix things without being able to reproduce the problem in the first place. 

Are you using RSA keys throughout (and not some DSA some RSA)?

You can configure ssh to 'not care' about miss-matches between credentials and known_hosts entries, if that were the case then you could ssh even when there was a miss-match. On the other hand (maybe?) sshfs uses a different ssh config (seems unlikely tho). 

I am still leaning towards it being an old key issue... that is easy to check, just remove known_hosts file (but make backup first).

Another suggestion I'll make is to try the ssh 'setup' from GutsyWorking on GutsyNotWorking:
&lt;b&gt;mv .ssh .ssh.orig&lt;/b&gt;
&lt;b&gt;scp -r jimzat@GutsyWorking:./.ssh .&lt;/b&gt;
Then try sshfs again. If that works then look at the differences between the directories using any of the following:
&lt;b&gt;diff .ssh .ssh.orig&lt;/b&gt;
&lt;b&gt;kompare .ssh .ssh.orig&lt;/b&gt;
&lt;b&gt;meld .ssh .ssh.orig&lt;/b&gt;</description>
		<content:encoded><![CDATA[<p>Hmm, it is rather tough to fix things without being able to reproduce the problem in the first place. </p>
<p>Are you using RSA keys throughout (and not some DSA some RSA)?</p>
<p>You can configure ssh to &#039;not care&#039; about miss-matches between credentials and known_hosts entries, if that were the case then you could ssh even when there was a miss-match. On the other hand (maybe?) sshfs uses a different ssh config (seems unlikely tho). </p>
<p>I am still leaning towards it being an old key issue&#8230; that is easy to check, just remove known_hosts file (but make backup first).</p>
<p>Another suggestion I&#039;ll make is to try the ssh &#039;setup&#039; from GutsyWorking on GutsyNotWorking:<br />
<b>mv .ssh .ssh.orig</b><br />
<b>scp -r <a href="mailto:jimzat@GutsyWorking:./.ssh">jimzat@GutsyWorking:./.ssh</a> .</b><br />
Then try sshfs again. If that works then look at the differences between the directories using any of the following:<br />
<b>diff .ssh .ssh.orig</b><br />
<b>kompare .ssh .ssh.orig</b><br />
<b>meld .ssh .ssh.orig</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimzat</title>
		<link>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-185</link>
		<author>jimzat</author>
		<pubDate>Mon, 25 Feb 2008 04:10:26 +0000</pubDate>
		<guid>http://linux.dsplabs.com.au/sshfs-read-connection-reset-by-peer-p73/#comment-185</guid>
		<description>I am getting the "read: Connection reset by peer" message also when I attempt to sshfs from one of my Gutsy boxes into a Dapper box.  (The connection from my other Gutsy box to  Dapper is OK.)  But when I ssh from the Gutsy boxes into Dapper everything is fine with no warnings.

This doesn't appear to be an RSA key issue, what else could it be and how should I diagnose it?

jimzat</description>
		<content:encoded><![CDATA[<p>I am getting the &#034;read: Connection reset by peer&#034; message also when I attempt to sshfs from one of my Gutsy boxes into a Dapper box.  (The connection from my other Gutsy box to  Dapper is OK.)  But when I ssh from the Gutsy boxes into Dapper everything is fine with no warnings.</p>
<p>This doesn&#039;t appear to be an RSA key issue, what else could it be and how should I diagnose it?</p>
<p>jimzat</p>
]]></content:encoded>
	</item>
</channel>
</rss>

