NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

wagb4's avatar
wagb4
Aspirant
Sep 11, 2014

SSH Connect to NAS

Using a ReadyNAS model 102 with firmware version 6.1.8.

I enabled SSH service but cannot mount a share using "sshfs". Has anyone been able to mount a share using SSH, and if so how do you do it?

I have tried variations on this theme:

jim@WS-2 ~ $ sshfs -o nonempty jim@192.168.xxx.xxx:/FileSync /tmp/nas
jim@192.168.xxx.xxx's password:
remote host has disconnected


Using a regular user and the admin user, both give the same results - "remote host has disconnected". User jim is the owner of FileSync Share on the NAS. I tried with and without the Volume name (data) as well as with no optoins on the sshfs command.

I don't see anywhere that SSH gets enabled for a specific share, like the other protocols (SMB, NFS, etc). Am I correct that in System > Settings > Support is only for "Remote" (as in ReadyCloud or ReadyNAS Remote) usage and it stays disabled for normal LAN access? I even tried enabliing that setting, but did not work so I disabled that setting.

14 Replies

Replies have been turned off for this discussion
  • try "cat /etc/passwd" if the shell is /bin/false the user is not allowed to login to the machine and therefore not allowed to login via SSH.
    Another simple test would be to try to SSH in without rsync...

    On linux, root is used when there is no other option left because if it were to be compromised somehow this would allow full access to the machine, and daemons are privileged targets, so using "limited" users makes sense.
  • Well, I can SSH to the NAS, using a normal user "jim", but the connection is closed right away - I presume the Welcome message means the password was accepted. Then I tried to SSH as user "root" but I don't know the password. I tried nothing (CR) and "password" and the admin user's password - none work.

    jim@WS-2 ~/Desktop $ ssh jim@192.168.0.215
    jim@192.168.0.215's password:

    Welcome to ReadyNASOS 6.1.9

    Connection to 192.168.0.215 closed.

    jim@WS-2 ~/Desktop $ ssh root@192.168.0.215
    root@192.168.0.215's password:
    Permission denied, please try again.
    root@192.168.0.215's password:
    Permission denied, please try again.
    root@192.168.0.215's password:
    Connection closed by 192.168.0.215
    jim@WS-2 ~/Desktop $


    How do I find out what NetGear set as the root password? I looked in the software documents for OS6 and it is not there. I don't think I want to use it, but I should know it and stash that information away somewhere in case I do need it some day.

    So SSH to the NAS for one of the normal users on the NAS connects but then something on the NAS is closing the connection right away. User jim is valid on all my Linux computers and the NAS all with the same UID value and password. The user I used in the rsync command is not a user on any computers, nor the NAS. It was created only for rsync. Therefore that user does not have an entry in any /etc/passwd or is a member of any group on any of my computers, all my normal users on the computers have the shell set to /bin/bash. SSH to the NAS using that rsync user fails, the same as root in the code block above - it will not accept the valid password.

    Thanks
  • mdgm-ntgr's avatar
    mdgm-ntgr
    NETGEAR Employee Retired
    Try toggling SSH off and on under System > Settings > Services > SSH or change your admin password. The password should be the same as the admin password.
  • Well I don't believe it - changing the admin password (to what I thouhgt it was already) worked. I can ssh in to the NAS as user root and execute commands.

    I tried ssh as another user and it kicks me out - so I guess that is saying only root can ssh into the NAS, as someone implied.

    I altered my rsync command to use root as the user and it worked!

    I'm still a little confused about how to refer to locations on the NAS, in rsync destination paths, but I'll figure that out. I guess the /data (volume) is needed and the share name (Backup in my case) Backup is the only share with Rsync set active. But my rsync command created a subdirectory inside a directory that was already there by the same name instead of putting the files in the existing directory. I probably told Rsync to do that.

    jim@WS-2 ~/Desktop $ ssh root@192.168.0.215
    root@192.168.0.215's password:

    Welcome to ReadyNASOS 6.1.9

    root@spar:~# cat /etc/passwd
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    < removed lines >
    root@spar:~# logout
    Connection to 192.168.0.215 closed.
    jim@WS-2 ~/Desktop $ ssh jim@192.168.0.215
    jim@192.168.0.215's password:

    Welcome to ReadyNASOS 6.1.9

    Connection to 192.168.0.215 closed.
    jim@WS-2 ~/Desktop $ rsync -h --progress --stats -r -tgo -p -l -D --update --delete-after /home/jim/TestFiles root@192.168.0.215:/data/Backup/TestFiles
    root@192.168.0.215's password:
    building file list ...
    40 files to consider
    TestFiles/

    < removed lines >

    Number of files: 40
    Number of files transferred: 35
    Total file size: 14.20M bytes
    Total transferred file size: 14.20M bytes
    Literal data: 14.20M bytes
    Matched data: 0 bytes
    File list size: 1.58K
    File list generation time: 0.035 seconds
    File list transfer time: 0.000 seconds
    Total bytes sent: 14.21M
    Total bytes received: 692

    sent 14.21M bytes received 692 bytes 1.50M bytes/sec
    total size is 14.20M speedup is 1.00
    jim@WS-2 ~/Desktop $


    So thanks, this gets me going in the right direction.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More