LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-13-2015, 07:19 PM   #1
valinote
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
Can't sshfs as non-root user-->"remote host has disconnected"


I know this problem has been solved before, but after much frustration I just can't seem to get it sorted out on my own. I have an original pink E02 Pogoplug with Optware and openssh installed on it as a file server on port 22222, and several laptops/netbooks with various versions of linux (using Crunchbang at the moment to write this).

The problem is that sshfs connects and works fine when I connect to the pogoplug as root, but fails with "remote host has disconnected" error when I attempt to connect as any other non-root user. Here's what I have tried thus far:

1. As per this link, I verified that sftp-server is present at /opt/libexec/sftp-server and that in /opt/etc/openssh/sshd_config the following line is present and uncommented...
Subsystem sftp /opt/libexec/sftp-server

2. On advice from the same post, on the crunchbang client I typed...
Code:
ssh -p 22222 foobar@hostip /bin/true
and received a response...
Code:
foobar@hostip's password:
But it was advised "If the above command produces any output, then you need to modify your shell initialization." So as recommended I modified /home/foobar/.bash_profile to be...
Code:
if [ "$SSH_TTY" ]
then
   source ~/.bash_profile_real
fi
and added file /home/foobar/.bash_profile_real as...
Code:
export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin
echo "Completed bash_profile_real init!"
3. So here's the command that works...
Code:
sshfs -p 22222 -odebug,sshfs_debug,loglevel=debug root@192.168.1.100: ~/root_mountpoint
and the failing command...
Code:
sshfs -p 22222 -odebug,sshfs_debug,loglevel=debug foobar@192.168.1.100: ~/foobar_mountpoint
with associated debug output as follows...
Code:
SSHFS version 2.3
FUSE library version: 2.8.6
nullpath_ok: 0
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-oPort=22222> <-ologlevel=debug> <-2> <foobar@192.168.1.100> <-s> <sftp>
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22222.
debug1: Connection established.
debug1: identity file /home/foobar/.ssh/id_rsa type -1
debug1: identity file /home/foobar/.ssh/id_rsa-cert type -1
debug1: identity file /home/foobar/.ssh/id_dsa type -1
debug1: identity file /home/foobar/.ssh/id_dsa-cert type -1
debug1: identity file /home/foobar/.ssh/id_ecdsa type -1
debug1: identity file /home/foobar/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9
debug1: match: OpenSSH_5.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA e4:c0:9e:22:7a:25:3c:69:19:76:76:68:69:fd:27:b0
debug1: checking without port identifier
debug1: Host '192.168.1.100' is known and matches the RSA host key.
debug1: Found key in /home/foobar/.ssh/known_hosts:1
debug1: found matching key w/out port
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/foobar/.ssh/id_rsa
debug1: Trying private key: /home/foobar/.ssh/id_dsa
debug1: Trying private key: /home/foobar/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
foobar@192.168.1.100's password: 
debug1: Authentication succeeded (password).
Authenticated to 192.168.1.100 ([192.168.1.100]:22222).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 1944, received 2000 bytes, in 0.1 seconds
Bytes per second: sent 21948.5, received 22580.8
debug1: Exit status 1
remote host has disconnected
My head's spinning at this point, so any advice would be kindly appreciated. Thanks in advance...8-]

-SteveD

Last edited by valinote; 02-15-2015 at 10:05 AM. Reason: Correct username in log
 
Old 02-15-2015, 09:04 AM   #2
valinote
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
One point I forgot to mention in the above description is that ssh (not sshfs) works fine on both the root and user accounts without issue. Also I made sure the mount point folder on the client system is owned by the account issuing the sshfs command. I'm open to any suggestions...

-SteveD

Last edited by valinote; 02-15-2015 at 09:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SSHFS: How to mount remote directory of the root to non root user? postcd Linux - Security 1 02-11-2014 01:35 AM
Pause processes in remote host and resume execution in another remote host Saeya Darsan Linux - General 5 10-22-2013 01:51 AM
unable to ssh to remote host with normal user, but suresh.k Linux - Security 13 08-06-2013 09:41 AM
nis user login failure from remote host (ssh,sshd) freeindy Linux - Networking 1 01-18-2008 06:16 AM
sshfs error when mounting "remote host has disconnected" thew00t Linux - Server 3 04-14-2007 06:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration