Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[HOWTO] Use sshfs from linux
#1
If you happen to be a linux user then using sshfs to access your N2800 could prove to be very useful. As a normal non-root user, try this with your NAS IP and NAS admin password...

Code:
mkdir ~/thecus
sshfs -o idmap=user root@192.168.1.100:/ ~/thecus

<!-- m --><a class="postlink" href="https://wiki.archlinux.org/index.php/Sshfs">https://wiki.archlinux.org/index.php/Sshfs</a><!-- m -->
<!-- m --><a class="postlink" href="https://help.ubuntu.com/community/SSHFS">https://help.ubuntu.com/community/SSHFS</a><!-- m -->
Reply
#2
If you happen to be a linux user then using sshfs to access your N2800 could prove to be very useful. As a normal non-root user, try this with your NAS IP and NAS admin password...

Code:
mkdir ~/thecus
sshfs -o idmap=user root@192.168.1.100:/ ~/thecus

<!-- m --><a class="postlink" href="https://wiki.archlinux.org/index.php/Sshfs">https://wiki.archlinux.org/index.php/Sshfs</a><!-- m -->
<!-- m --><a class="postlink" href="https://help.ubuntu.com/community/SSHFS">https://help.ubuntu.com/community/SSHFS</a><!-- m -->
Reply
#3
Further to the above post, if you followed how to do SSH root logins without a password, and it works for you, then you can streamline the use of using sshfs like this...
Code:
alias thecus='sshfs -o idmap=user,reconnect,transform_symlinks thecus:/ ~/thecus'
where your ~/.ssh/config entry would look something like this (after a ssh-keygen -f ~/.ssh/thecus)...
Code:
Host thecus
  User root
  Port 22
  Hostname 192.168.1.100
  IdentityFile ~/.ssh/thecus
  StrictHostKeyChecking no
  Ciphers arcfour,blowfish-cbc
  Compression yes
  AddressFamily inet
and now you can just type thecus to mount the root of your Thecus NAS securely into a ~/thecus folder in your normal non-root users home dir. And, even though you are a normal user on your local desktop/laptop you have root perms on the remote NAS (touch ~/thecus/xxx locally and check /xxx via ssh on the NAS). Assuming your local and remote user IDs are the same, ie; user1 = 1001, user2 = 1002, then you can chown and chmod just as you would for local files. The advantage to using sshfs rather than ssh is that with sshfs you are still really on your local computer with all it's facilities and GUI apps (like using Kate or even qtcreator to edit files on the NAS).
Reply
#4
Hi,

I really wish it was this simple. I expected this to work, but unfortunatley
it does not. If you try (with the newest firmware) to mount using sshfs
sshfs -o idmap=user <!-- e --><a href="mailto:root@xxx.xxx.xxx.xxx">root@xxx.xxx.xxx.xxx</a><!-- e -->:/ ~/thecus

the system, after typing root passwd, answers with:
remote host has disconnected


I am struggling with this already a few days. I can ssh to my NAS, and also use
scp. I cannot use sftp or sshfs. I cannot find any sftp-server subsystem on
the NAS, so this is probably the issue. Where did you get one from?

Cheers,

Arnold
Reply
#5
Hi,

I really wish it was this simple. I expected this to work, but unfortunatley
it does not. If you try (with the newest firmware) to mount using sshfs
sshfs -o idmap=user <!-- e --><a href="mailto:root@xxx.xxx.xxx.xxx">root@xxx.xxx.xxx.xxx</a><!-- e -->:/ ~/thecus

the system, after typing root passwd, answers with:
remote host has disconnected


I am struggling with this already a few days. I can ssh to my NAS, and also use
scp. I cannot use sftp or sshfs. I cannot find any sftp-server subsystem on
the NAS, so this is probably the issue. Where did you get one from?

Cheers,

Arnold
Reply
#6
Can you login with ssh as root or a non-root user without a password?

If that is not working then some basics are not set up right. Keep in mind that you need to chmod 700 /raidsys/0/root (and the /raidsys/0/roo/.ssh folder) otherwise the ssh daemon will keep asking for a password. The standard ssh daemon is running as /opt/bin/stond -f /tmp/sshd/sshd_config and my ssh_config has a Subsystem sftp /opt/openssh/libexec/sftp-server, which exists on my system.
Reply
#7
Can you login with ssh as root or a non-root user without a password?

If that is not working then some basics are not set up right. Keep in mind that you need to chmod 700 /raidsys/0/root (and the /raidsys/0/roo/.ssh folder) otherwise the ssh daemon will keep asking for a password. The standard ssh daemon is running as /opt/bin/stond -f /tmp/sshd/sshd_config and my ssh_config has a Subsystem sftp /opt/openssh/libexec/sftp-server, which exists on my system.
Reply
#8
Hi,

Yes, non-root users can log in. Originally not, but I added (bit careless, I know)
AllowUsers *
to the /etc/ssh/sshd_config.

However, that is not the issue. Even root cannot sftp/sshfs.

In fact, there is no /opt/openssh at all. How did you get that?
This is exactly what I want. I only have something called dropbear running,
which appears to be a simple ssh server. I did not install it, it is (I assume)
part of the Thecus software stack.

Could you perhaps make a tarball of your /opt/openssh and post it?
Since openssh is free and open software, you would not violate any
copyright.

B.t.w. about possible misconfiguration of the NAS....what possibly could I have done wrong?
The thing is straight from the shop. You take the thing out of the box, install discs, connect
to your switch. turn it on. Start a webbrowser with the right IP-adres, log in (admin) and turn
on ssh (and install raid of course). Is there something missing in that reasoning?


Cheers,

Arnold
Reply
#9
Hi,

Yes, non-root users can log in. Originally not, but I added (bit careless, I know)
AllowUsers *
to the /etc/ssh/sshd_config.

However, that is not the issue. Even root cannot sftp/sshfs.

In fact, there is no /opt/openssh at all. How did you get that?
This is exactly what I want. I only have something called dropbear running,
which appears to be a simple ssh server. I did not install it, it is (I assume)
part of the Thecus software stack.

Could you perhaps make a tarball of your /opt/openssh and post it?
Since openssh is free and open software, you would not violate any
copyright.

B.t.w. about possible misconfiguration of the NAS....what possibly could I have done wrong?
The thing is straight from the shop. You take the thing out of the box, install discs, connect
to your switch. turn it on. Start a webbrowser with the right IP-adres, log in (admin) and turn
on ssh (and install raid of course). Is there something missing in that reasoning?


Cheers,

Arnold
Reply
#10
Oh right, dropbear is the original light SSH replacement used by most embedded devices. It seems Thecus now include openssh but they use a symlink from sshd to stond for some reason. I'm using a 64bit N2800 so I'm not sure posting my /opt/openssh is any good for you if you don't have a similar model (N4800, N5550). Can you look around for a openssh module for your model?

I've got a Raspberry Pi with dropbear on it so I'll check it out later but I suspect you are right, there may be no sftp-server option with dropbear. Sorry, I should have asked what model of Thecus you are using but I'm a Thecus noob.
Reply
#11
Oh right, dropbear is the original light SSH replacement used by most embedded devices. It seems Thecus now include openssh but they use a symlink from sshd to stond for some reason. I'm using a 64bit N2800 so I'm not sure posting my /opt/openssh is any good for you if you don't have a similar model (N4800, N5550). Can you look around for a openssh module for your model?

I've got a Raspberry Pi with dropbear on it so I'll check it out later but I suspect you are right, there may be no sftp-server option with dropbear. Sorry, I should have asked what model of Thecus you are using but I'm a Thecus noob.
Reply
#12
I have an N2200evo, which has a Cavium Soc (I think it is actually an ARM CPU).
Indeed, your binaries would be useless.

I cannot find any openssh on my NAS. I did a 'find' on the entire filesystem. Nothing...
B.t.w. I dont know what you mean with 'stond'. I cannot find that too.

I searched everywhere for an openssh module for the N2200EVO.
No success at all. I really start to think, that this is my worst purchase ever.
I really need a full-fledged ssh implementation.

Thanks for your help.

Cheers,

Arnold
Reply
#13
I have an N2200evo, which has a Cavium Soc (I think it is actually an ARM CPU).
Indeed, your binaries would be useless.

I cannot find any openssh on my NAS. I did a 'find' on the entire filesystem. Nothing...
B.t.w. I dont know what you mean with 'stond'. I cannot find that too.

I searched everywhere for an openssh module for the N2200EVO.
No success at all. I really start to think, that this is my worst purchase ever.
I really need a full-fledged ssh implementation.

Thanks for your help.

Cheers,

Arnold
Reply
#14
Nice machine. What does grep "model name" /proc/cpuinfo say? It may be possible to install an OpenWrt or optware SSH package if the right CPU architecture can be worked out.

I agree with you about ThecusOS. It's okay for simple stuff that the web interface is made for but anything outside of that fairly narrow functionality is just so painful to implement. I'd much rather a "real" linux OS like Archlinux or even Debian.
Reply
#15
Nice machine. What does grep "model name" /proc/cpuinfo say? It may be possible to install an OpenWrt or optware SSH package if the right CPU architecture can be worked out.

I agree with you about ThecusOS. It's okay for simple stuff that the web interface is made for but anything outside of that fairly narrow functionality is just so painful to implement. I'd much rather a "real" linux OS like Archlinux or even Debian.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [HOWTO] Use sshfs from linux 0 5,899 Less than 1 minute ago
Last Post:

Forum Jump:


Users browsing this thread: 1 Guest(s)