How to mount a remote ssh filesystem using sshfs October 28, 2005
Posted by Carthik in ubuntu.trackback
SSH is protocol to transfer files securely. Like FTP, but more secure. Many hosting services offer their client the ability to remotely login to their hosting account using ssh. Transferring files to an from an ssh account can be done using the scp command. However, it would be neat if you could mount a remote folder that you can access using ssh on your local computer, so that you can access files on an ssh account just like they were local files on your pc, right? Well now you can! Mount a folder in an ssh account, edit the files locally and save the files, and the file on the ssh server changes too! Isn’t it awesome!!!
We will use sshfs to acheive our goal. The following guide will step you through the process of mouting file systems over ssh on Ubuntu 5.10 Breezy systems.
sshfs:
sshfs is a filesystem client based on the SSH File Transfer Protocol.
Since most SSH servers already support this protocol it is very easy to
set up: i.e. on the server side there’s nothing to do. On the client
side mounting the filesystem is as easy as logging into the server with
ssh.
Install sshfs by doing a:
$sudo apt-get install sshfs
This will also install fuse-utils and libfuse2, which are required.
Now, let us create a local directory where you want the files mounted. You should create the directory and make yourseld the owner of the directory:
$sudo mkdir /media/dir-name
$sudo chown your-username /media/dir-name
Where “dir-name” is the name of the directory on your local computer where you want to access the files from the remote computer. Say I want the files on the server to be available at /media/home-pc. I want this because the “server” in this case is the desktop I have at home, which allows me to access it through ssh. Let us use “home-pc” as an example for this guide. “your-username” is your username on the local computer.
Go to System->Administration->Users and Groups, select the group “fuse” and then add yourself to this group.
If you prefer to do it the easy way, on the commandline, then use
$sudo adduser your-username fuse
I don’t want to provide a terminal command for adding yourself to a group since there doesn’t seem to be an easy way to add yourself or any user to a group. The only command I know of is the usermod -G command and for this command, you need to list all the groups the user should belong too, even the ones that he/she is already a member of! Anyone know any better on how to add a user to a new group, without having to know what groups he/she is already a member of?
Thanks Shot.
For security reasons, the /usr/bin/fusermount binary is installed in such a way that users cannot execute it. You will have to log out and log in again, to add yourself to the group “fuse”.
Once you have done the above, you can use sshfs to mount the directory you need on the remote host to your local system!
For example, say I want to mount the “/stuff” directory on my home-run server, which has the domain name “example.com”. I would do it by executing the following command:
$sshfs example.com:/stuff /media/home-pc
Where “/stuff” is the folder on the computer with the domain name “example.com”, which I want to mount and access on my local computer at the location /media/home-pc. Remember that the /media/home-pc directory must exist and be owned by you, the user. I already mentioned how to do this in the initial part of this guide.
If you get the following error:
fusermount: fuse device not found, try ‘modprobe fuse’ first
You will have to load the fuse module by doing:
$sudo modprobe fuse
You can add fuse to the modules that are loaded on startup by editing the file /etc/modules and adding a line with only the word “fuse” in it, at the end.
and then issue the sshfs command above again.
To unmount the directory once your work is done, use the command:
$fusermount -u
for example, in my case, I would use
$fusermount -u /media/home-pc
Hat tip: Jorge
More Info: SSH filesystem







[...] Niedawno zacząłem korzystać z dobrodziejstw sshf, a dziś wpadłem na opis krok po kroku tego wynalazku. Wygodne, szczególnie że nie ma jakiegoś fajnego graficznego klienta, żeby wygodnie korzystać z FTP po SSH – nie, gFTP nie jest wygodny. [...]
“I don’t want to provide a terminal command for adding yourself to a group since there doesn’t seem to be an easy way to add yourself or any user to a group.?
adduser user group
Ah! adduser — the debian way!! Sorry I overlooked that one. To be honest it did not cross my mind at all!
Thank you, thank you!
Very, very nice idea! I’ll be trying this during the week!
[...] I had never heard of sshfs, but here’s a quick tutorial on getting it working. Looks very useful! Related Stories (how, mount, remote, ssh, filesystem, using, sshfs) [...]
Unfortunately I cant find sshfs using apt-get in my Ubuntu 5.04. I have added all the sources I had found in ubuntuguide.org..
[...] Ubuntu Blog has one of the most useful tips yet: How to mount a remote filesystem using SSH. [...]
Yanis,
Try http://packages.ubuntu.com/sshfs to see if the package exists in the Ubuntu repos.
I find that it is available only for Breezy. You may not have upgraded to Breezy, which is why you can’t see it yet.
Argh! I’m running Hoary as well. Looks like I’ll be using scp for a little longer!
Donncha,
Glad to know you use Ubuntu! Well, upgrading to breezy shouldn’t take too long
This is great! Does anyone know if this can work on a Mac with OS 10.4.3?
Fink nor DarwinPorts have this in the ports yet.
Any tips and/or suggestions would be appreciated!
Finally got to play with this, it’s great!
One more comment: “For some reason, the /usr/bin/fusermount binary is installed in such a way that users cannot execute it.?
This is, I believe, by design. The default permissions of /usr/bin/fusermount are
-rwsr-xr– root fuse
wchich mean executable by the fuse group, suiding root.
Did you log out and back in after adding yourself to the fuse group? I did, and I didn’t have to chmod the file.
The idea to restrict the access to fusermount is a good one; think of all the pseudo-users who can use fusermount if you chmod the file (man, lp, www-data, nobody, dhcp, syslog, cupsys, countless others).
Tip: To check whether you’ve actually added yourself to a group or still need a reboot, use the groups command.
[...] November 5th, 2005 sshfs rocks! I don’t know if you have ever played with fuse (gmail drive, anyone?), but there’s something new for fuse, and it’s way cool. Jochem pointed me here, so credits go to him sshfs is like nfs on steroids, and even better. No hassle with dark firewall settings and unsecure connections, now you can safely mount a remote filesystem, and it is transported over a ssh connection! And best of all; there’s nothing to be changed on the server-side (ok, it should support the ssh2 protocol, but anyone who doesn’t: shame on you), and you can access your mountpoint the same way as any other mountpoint, how cool is that, so CVS commits, chmod’s, cd’s, mv’s, it’s all in the game… Go check it out, because it’s really, really cool! [...]
SSHFS – Just what I needed
Oh man, talk about good timing. I’m back home in Toronto, and I’m using my desktop once again which has Ubuntu Linux installed. I have a μC++ assignment due on Monday, so I’ll be programming all weekend.
The problem is… μC++….
[...] Source: Ubuntu Blog [...]
Shot,
Good point there! Thanks again.
Hi There,
It will be nice to have a windows port — that will get the biggest userBase for sshfs. This way, I can use mc(Midnight Commander) to access my multiple Linux Clusters.
BTW, does it allow me to have multiple mountPoints ?
Thank you,
BR,
~A
anjanb,
Yes, you can have multiple mount points — no problems there.
I am not sure what you mean by windows port, but I am sure that with cygwin, there might be someway of using this… unless since it needs the FUSE kernel module, it is impossible to get something like this working in Windows.
That said, I find Linux has far more to offer — much more diverse solutions, and the right tools for the job, for most jobs.
nice idea, thanks!
This would be so sweet to connect to my work server. When I tried it, though, I got the ‘try modprobe fuse first’ message, and when I tried ‘modprobe fuse’, I got this message:
FATAL: Error inserting fuse (/lib/modules/2.6.12-9-386/kernel/fs/fuse/fuse.ko): Operation not permitted
I must warn you, I am a complete Linux noob, but do you have any idea what the problem is/ how I could solve it? Thanks!
Nevermind, I realized I’d just forgotten to add the ’superuser do’ before ‘modprobe fuse’… d’oh! LIke I said, total noob… it’s working now, and how! Thanks for the great tip!
Hiya, I have another problem.
I’ve got the remote server mounted using sshfs, but when I use the file browser in ubuntu, I can’t create folders or copy files to it. Getting stuff from it is fine, but whenever I try to copy a file TO the remote destination, I get a message telling me I don’t have enough space. I’m also unable to delete files or create new files.
I’m guessing this is a permission problem – my local user is ‘joe’ and the remote user is ‘root’. Is there any way (other than 777 permissions) to get this working? Would setting up a ‘joe’ user on the remote machine give local ‘joe’ the needed permission?
[...] Finally, … finally get all the mount drives with sshfs. very rock solid and high security. [...]
[...] That’s why FUSE has been invented. This post describes how to mount, for example, a ssh directory using FUSE. [...]
Is it possible to mount using sshfs during login (e.g. adding a row in fstab?)?
Thx
[...] Ubuntu blog has neat article about how to mount filesystem using sshfs. To my mind this is quite useful feature. You could mount remote file system and for example write to it some kind of sensitive information and in case of robbery you won’t lose your data, because it wasn’t actually there. [...]
Im running WinSSHD v4.12 on Windows computer and Im trying to mount those shares.
Information on WinSSHD features can be found from here: http://www.bitvise.com/winsshd.html
Everything is fine, util I type following command:
sshfs @: /media/c
@’s password:
server version: 2, we need: 3
So something, some service, is ‘too old’ on WinSSHD or something like this.
Any suggestions?
Found a solution.
I uninstalled WinSSHD and installed Cygwin ( http://www.cygwin.com )
You can find a great tutorial for installing Open SSH on Cygwin from -> http://pigtail.net/LRP/printsrv/cygwin-sshd.html
I still have a problem.
On my Windows computer I’ve folder called MISC that is shared. MISC-folder is located on drive C:
Everyone has read rights to this folder.
\ has full control to this folder.
On my linux machine, typing:
sshfs @192.168.0.2:/MISC /media/c
Reports following: fusermount: failed to access mountpoint /media/c: No such file or directory.
Heeeelp!
Freaky. This doesnt suppor different kind of bracelets…
user\computer = \
user@ip:/MISC
[...] Tip of the hat to Ubuntonista and of course Miklos Szeredi. [...]
Hi Ubuntonista — this how-to here may be of interest to you too:
https://wiki.ubuntu.com/CheapSecureEncryptedRemoteVolumeHowTo
Thanks for the heads-up on fuse and sshfs!
FWIW, you should really remove this line from your howto:
sudo chmod +x /usr/bin/fusermount
You’re opening a security hole there.
When your UID is added to a new group, you need to either log out and log back in, or you need to run “newgrp fuse”.
You should try to keep world-executable SUID binaries on your box to an absolute minimum. If there’s a security problem with that binary, you’ll be immediately rootable (at least locally).
[...] How to mount a remote ssh filesystem using sshfs [...]
I’ve got the same question as my namesake above (reply #22): it doesn’t allow me to copy/move/rename files in the same way that I can with local files or, for example, as I can when I do the “Connect to Server” function in Nautilus. Nautilus tells me I can’t change these files because I don’t own them (maybe because the UID on the remote computer is not the same).
So for now I’m mounting using sshfs to mount and read files and a standard ssh connection to write them. This seems unnecessary, so I’d like to hear what I’m doing wrong.
I get the same problem as joe and joe2 above…can browse, but no write access… any ideas?
It’s only nautilus that seems to have a problem though. I can do things from a terminal and if i open a file in a txt editor it seems to be able to save it back ok. Just no drag and drop file management
Matthew, Shot, I have now edited the instructions to suggest logging out and logging in again to be able to mount the sshfs directory.
Matt, Joe2 and Joe,
I beleive those are nautilus problems. I used to get (and still do get) errors like “There is no space” to copy something, when there is 50+ GB of free space on the remote dir!
Use command line mv, cp etc to move files in, or use Konqueror if you dont mind using that
well it’s a shame…
I know a way with Kubuntu, konqueror and the fish protocole : it’s possible to browse through an ssh connexion, and permissions are respected. But I ‘d prefer to keep Nautilus and Ubuntu. I really dont want to switch on KDE.
Got it set up and it works, but I can’t to a ‘mv file1 file2′ in the terminal for some reason. I had to delete file2 and then move file1 to the new name.
how to mount remote folder? for examples: mount 192.168.0.197:/dev /mnt/dev ? this command error…error message is Permision Deni
I can mount my SSH-Server, but i can’t access to the mountpoint.
Here the debug output:
_______________________________________________________
Server version: 3
unique: 1, opcode: INIT (26), nodeid: 0, insize: 48
INIT: 7.3
INIT: 7.2
unique: 1, error: 0 (Success), outsize: 24
unique: 2, opcode: STATFS (17), nodeid: 0, insize: 40
unique: 2, error: 0 (Success), outsize: 64
unique: 3, opcode: STATFS (17), nodeid: 0, insize: 40
unique: 3, error: 0 (Success), outsize: 64
unique: 4, opcode: STATFS (17), nodeid: 0, insize: 40
unique: 4, error: 0 (Success), outsize: 64
unique: 5, opcode: STATFS (17), nodeid: 0, insize: 40
unique: 5, error: 0 (Success), outsize: 64
_______________________________________________________
What can i do?
btw. i have make a small Python menu tool:
https://opensvn.csie.org/traccgi/PyLucid/trac.cgi/browser/CodeSnippets/fuseSSHfs
Lieber Jedie– Ich habe deine CodeSnippets gesehen. Sehr nett!
Vielen dank.
Dear Jedie — I saw the CodeSnippets on your server that put a menu interface on sshfs. Very nice.
Thanks a lot. (German is not my first language!).
Firstly sshfs is cool and thanks for the helpful article.
This is off topic I fear but perhaps someone can help …
Anyone familiar with GNUCash? I was hoping that sshfs would allow me to stick my account files on a server so I could access them from whatever machine Im on, but I am getting this when I open the account:
“WARNING!!! GnuCash could not obtain lock for /xxxxxx/Accounts. That database may be on a read-only file system, or you may not have write permission for the directory. …”. It then warns that I *may* not be able to save changes.
This is not the case of course. I can write to that directory/those files (when opened with fish protocol or when I browse to the sshfs mount point). Incidently, an Accounts.LCK file is created if I press the button to open anyway … But when I click save, the Accounts file is replaced with the temporary file .fuse_hiddenxxxxxxxxxxx which promptly disappears leaving me with no data whatever.
Any thoughts? Thanks.
I am mounting the folder “filecopy” in the directory I created at my server with domain “CCT-MIS” I want to mount the filecopy folder, I
use this code:
sshfs CCT-MIS:/filecopy /home/bong-pc then I got this error,
sshfs: CCT-MIS: name or service not known
what will I do ? please help
I am mounting the folder “filecopy” in the directory I created at my server with domain “CCT-MIS” I want to mount the filecopy folder, I
use this code:
sshfs CCT-MIS:/filecopy /home/bong-pc then I got this error,
sshfs: CCT-MIS: name or service not known
what will I do ? please help
To mount sshfs so that nautilus can write to the folders just mount like this.
sshfs -o uid=500,gid=500 me@myserver:/home/me /local/mount
That should do it. You will need to cange the uid and gid to your uid.
To get your uid and gid just type in the following.
id -u
id -g
That will give you the values that you should use.
I hope this helps
[...] Here is yet another beautiful thing that linux lets you do – mount a ssh connection as a drive or folder like nfs. A tutorial is available on Ubuntu Blog. • • • [...]
sshfs, fuse, mounting remote dir’s via ssh
sshfs / fuse is as cool as it gets, hopefully I’ll be able to replace nfs with it, it would resolve a lot of security issues. Anyhow here’s a like to a Ubuntu centric article explaining the process.
Very helpful! I must say this is the best alternative so far. A tip: it’s very important to set the local directory permissions to your own account or you’ll get a permission denied error.
NIcely done, dude! Thanks.
Alternative to add an user to a group:
usermod -G new_group -a user
-a: append the group to the current user’s group list.
[...] Ubuntu Blog » How to mount a remote ssh filesystem using sshfs [...]
For some reason the Zend Development Environment can’t open/read files from a sshfs mount. Not sure if this is a Java problem or ZDE specific. Anyone run into sort of issue? I can read and write files fine from nautilus/gedit.
Hi,
This is awesome! I loved it. I have a question, doesn’t it use the rsa key pair in the .ssh directory? I setup all my machines so that i can login without a password, so I guess sshfs should not be asking me for a password right?
Thanks
Pavan
The problem is that it is asking for the password. Sorry forgot to mention!
What’s the best way to cache a password?
I can’t get it to work for me. I try the sshfs command and I get this:
share /media/networkpc/
ccc@ccc:~$ cat /etc/group | grep fuse
fuse:x:119:ccc
ccc@ccc:~$ ls -l /usr/bin/fusermount
-rwsr-xr– 1 root fuse 18328 2006-05-11 13:45 /usr/bin/fusermount
ccc@ccc:~$ sshfs myaccount@networkpc.icsaward.com
myaccount@networkpc.icsaward.com’s password:
fuse: failed to exec fusermount: Permission denied
I made sure my account is a member of the fuse group as you can see above. My account also has ownership of the shared folder under /media/
I can mount fine as root but not from my account. Then I try this:
ccc@ccc:~$ sshfs networkpc.icsaward.com:/share /media/networkpc/
ccc@networkpc.icsaward.com’s password:
fusermount: failed to open /dev/fuse: No such file or directory
What gives?
modprobe it
[...] The article How to mount a remote ssh filesystem using sshfs very well describes what I have to do to have my disk mount on my Mac disk on my Ubuntu system. [...]
I tried to mount a folder of a unix machine from my uni, for which I’m the owner. I created a folder /media/unix9e on my laptop and made myself the owner and granted all rights. I could mount the unix folder without any problems. But I don’t have the rights to change files :s. Before the “sshfs …” command the folder looks like this:
drwxrwxrwx 2 marnix root 4096 2006-11-06 14:48 unix9e
After the mount command the folder has changed to:
drwxr-xr-x 1 2132 130 4096 2006-11-02 13:15 unix9e
So the rights and ownership have changed, and I can’t do anything about it. Does this depend on our unix machines, and should I ask our system admin? Previous posts have mentioned the same problem I think, but so far no solution
[...] As Linux stuff goes, SSHFS was remarkably easy to install and set up. Using the handy directions over at Ubuntu Blog, I had it all working in about 20 minutes. I’ve been running it for a few days now and have yet to run into any bugs or performance issues. [...]
sorry to say that this does not work for me
at the end I have a ssh connection mounted on a directory whitch I can approach
if I do an: ls -ltr
I get :
?————– ? ? ? ? ? mountedDirectory
Any suggestions?
[...] It’s also simple to set up, requiring no configuration on the server. Following the general gist (I already had much of it set up) of the instructions found on a fellow Ubuntu users blog I can now mount remote directories by using: sshfs server:/my/remote/directory/ /my/local/mountpoint [...]
it work! I had few problems with fuse but work!
It works great!!
And it’s fast!!!
Now I just have to figure how to mount it at boot time…
Thanks!!
Really like the concept of sshfs. It works, but is slow as molasses with some of the large files (files >30Mb) I have to grep through. Like 30 to 40 times slower than being on the actual box. Any one know any performance tweaks. Thanks
Yar, I’d run the grep as a remote command with ssh, rather than using sshfs to do the job. Like:
ssh me@remotecomputer \
grep -i “wtf” bigfile.txt > bigfile.txt.grepped.txt
Then you can pick up bigfile.txt.grepped.txt with sshfs.
This way, grep runs on the remote computer, rather than hauling the whole file across the network.
Thanks for tip! Did not know you could attach commands to the end of ssh like that!
[...] How to mount a remote ssh filesystem using sshfs [...]
sshfs works great! But something I found out was that I couldn’t access my mount point with multipule connections (for example streaming an mp3 and browsing files). The solution that worked for me is described in a great post over at debian-administration.org. You basically reuse a SSH connection and can do several things at the same time!
Make sure to read the comments also.
Reusing existing OpenSSH v4 connections:
http://www.debian-administration.org/articles/290
Just an FYI: For those Apple users out there with OS X, Amit Singh at Google has ported FUSE to OS X (MacFUSE). It can be found here:
http://code.google.com/p/macfuse/
[...] I had to redo this after a recent system upgrade). A good writeup with helpful comments is here: How to mount a remote ssh filesystem using sshfs. The great thing about sshfs is that it allows me to use my remote systems transparently on [...]
[...] How to mount a remote ssh filesystem using sshfs http://ubuntu.wordpress.com/2005/10/28/how-to-mount-a-remote-ssh-filesystem-using-sshfs/ [...]
After I’ve installed fuse on Ubuntu 6.10 – the Edgy Eft – released in October 2006, I got :
“fusermount: failed to open /dev/fuse: No such file or directory”
while trying to run sshfs
I fixed the problem by changing the owner of /dev/fuse to be root:fuse
>sudo chown root:fuse /dev/fuse
After this sshfs mounted correctly; don’t forget also to log out after you add yourself to the fuse group to make sure that you really are in the fuse group;
[...] Super easy, super simple, fast, and secure. Here are a couple of more resources that I used as references when doing this: Ubuntu Forums HOWTO, and Ubuntu.wordpress.com. [...]
Anybody know how to make sshfs run out of cron? I’ve written a script that checks all the things I have mounted periodically and will remount them if they have become unmounted for some reason. However in the cron envirnment, sshfs doesn’t run properly natively. Thanks
gerard said:
sorry to say that this does not work for me
at the end I have a ssh connection mounted on a directory whitch I can approach
if I do an: ls -ltr
I get :
?————– ? ? ? ? ? mountedDirectory
Any suggestions?
I was getting the same behavior. I don’t know if I was doing the same thing that you were doing, but I’ll post the solution here in case it helps you or someone else. I was using sshfs in the following way:
$ sshfs user@host:~ some_directory/
This succeeded, but from the debug output, it looked to me like Fuse was literally trying to mount the directory named “~”, which of course I wanted converted to /home/user (or equivalent) on the server. When I spelled it out on the command line (`sshfs user@host:/home/user some_directory/`), it worked.
I also did an experiment. I tried the following command:
$ sshfs user@host:/foo some_other_directory/
And that worked, with the same result (question marks all around) although /foo also does not exist on the server. Clearly, the sshfs interface could use a bit of additional error reporting.
Regardless of all of this, thank you Carthik for this bit of useful reporting.
SuSe 10.2 — x86_64
FANTASTIC!!!!!!
sshfs comes with SuSe.
I followed your instructions and everything worked great!
Just one observation:
Using Yast I added a new group (called fuse) and added my user to it.
Congratulations. The text is very clear and direct.
This was working yesterday, but today I get:
fusermount: failed to open /dev/fuse: No such file or directory
The directory does in fact not exist…. and yet this was fine the day i installed it.
Let’s make it easier!!!
(in german: http://wiki.ubuntuusers.de/FUSE/sshfs)
requirements:
1. a line fuse in /etc/modules
2. the package sshfs installed
3. a line in /etc/fstab
sshfs#username@yourserver:/pathonserver/ /yourmountdir fuse uid=1003,gid=100,umask=0,allow_other 0 0
and now the best an easiest:
4. a line in menu->system->settings->sessions->startup
sshfs username@yourserver:/pathonserver/ /yourmountdir
That’s awful -> with starting the session, there is a password-question and no need of terminals!!!!
[...] old article on mounting remote directories using sshfs is what prompted J Wynia to write [...]
[...] old article on mounting remote directories using sshfs is what prompted J Wynia to write it. Previous Post: Vincent Untz: Summer of Code [...]
[...] the virtues of sshfs/fuse – mount remote filesystems via SSH. Reasonably-clear instructions can be found here with one omission: “sudo chown root.fuse [...]
Hello,
I can’t install sshfs on Ubuntu Edgy, this is why:
”
$ sudo apt-get install sshfs
Lendo Lista de Pacotes… Pronto
Construindo Árvore de Dependências
Reading state information… Pronto
E: Impossível achar pacote sshfs
”
The last line in English (I think): “that’s impossible to find out the sshfs package”
But there is the sshfs package at http://packages.ubuntu.com/edgy/utils/sshfs
What I’m doing wrong, please?
More information:
“$ uname -a
Linux ubuntu 2.6.17-11-generic #2 SMP Thu Feb 1 19:52:28 UTC 2007 i686 GNU/Linux
”
Thanks in advance.
Hello,
Now, I know the answer and I would like to suggest the following:
For newbies, the sshfs for Ubuntu Edgy (https://launchpad.net/ubuntu/edgy/i386/sshfs/1.6-1) is obtained from the repository (or component) Universe, which you can use through Software Repositories (https://help.ubuntu.com/6.10/ubuntu/desktopguide/C/extra-repositories.html)
Regards.
I think it’s not so easy to use sshfs:
a) I can logon by ssh normally:
“vinicius@ubuntu:~$ ssh -i openssh_vinicius_at_ubuntu vinicius@fedora
Last login: Sat Mar 10 02:25:26 2007 from 10.11.11.11
[vinicius@fedora ~]$
”
b) but I can’t do that with sshfs:
”
vinicius@ubuntu:~$ sshfs vinicius@fedora:/home/vinicius ~/sshfs-vinicius-at-fedora
Permission denied (publickey).
remote host has disconnected
”
What I’m doing wrong, please?
Local (client): Desktop Ubuntu Edgy 6.10
Remote (server): Fedora Core 6
Thanks in advance.
Hello,
After editing /etc/ssh/ssh_config:
”
…
IdentityFile ~/openssh-vinicius-at-ubuntu
PubkeyAuthentication yes
…
”
I was able to use use sftp and sshfs.
If you have a default sshd_config at the SSH server and a default ssh_config at the client then the use of sftp or sshfs will be easy. But generally to increase the security: we change the port, enable only publickey authentication and so on.
Regards.
[...] sshfs/fuse e’ l’ultima spettacolare invenzione che permette di montare volumi remoti con due click e via SSH, uno spettacolo che consiglio a tutti di provare anche per montare volumi Windows via Samba, basta andare su Places -> Connect to Server e selezionare SSH, a dir poco mitico. [...]
usermod -a -G fuse username
the easy way;-)
Great work on this howto. I was running out of disk space on my laptop so I decided getting rid of 52 gigs of music files would help. Looked into using samba and decided sshfs was worth checking out. Works super well on my kubuntu edgy laptop and now I use amarok with mysql and a remote collection shared over sshfs.
[...] -u blah Post a comment — Trackback URI RSS 2.0 feed for these comments This entry (permalink) was [...]
sshfs
I have one remote account of my institute with NFS. Whenever some network has problems, I cannot login my laptop or whatever. I have to stop to do something. I do not like this situation. Then I decide to use local account of my laptop. However, wheneve..
Attention Ubuntu Edgy users:
When I tried to use sshfs to mount a remote filesyste, I was receiving the following error:
fusermount: failed to open /dev/fuse: Permission denied
The fuse module was installed (and contained in /etc/modules). I had added myself to the “fuse” group. Everything seemed set.
So, I did a bit of tracking-down the problem … For some reason, when I installed sshfs on Ubuntu Edgy, the /dev/fuse device was created with ownership root.root (i.e. user and group = root).
To fix the problem, I had to change the group to “fuse” to get this to work:
$ sudo chmod root.fuse /dev/fuse
Once this was done, sshfs worked fine for me on Edgy. HTH someone!
Dave
Oops – just a correction to the above post.
I meant to say:
$ sudo chown root.fuse /dev/fuse
(Not chmod, sorry).
D.
Hey,
You might want to replace:
$ sudo adduser your-username fuse
with:
$ sudo adduser `whoami` fuse
for people (like myself) who get an error, hit themselves over the head, and then replace the ‘your-username’ to, well, their username.
Thanks.
At lest in Debian, /usr/bin/fusermount has an execution flag for “fuser” group; so, just add your username to this group.
I too was having problems writing files in gedit yet if I used vim it works without problem. I have found the problem is caused by the backup feature of gedit i.e. it seems to try and create a backup before writing. Quick-fix-solution; disable backup creation in gedit.
the rename syscall does not seem to work properly over sshfs.
It always give permission denied when renaming to an existing file.
touch foo; ltrace sed -i ’s/foo/bar/’ foo 2>&1 | grep rename
rename(”./sedZhKQIw”, “foo”) = -1
vfprintf(0xb7f97560, “cannot rename %s: %s”, 0xbff5db34cannot rename ./sedZhKQIw: Operation not permitted) = 50
another example:
touch foo bar; mv foo bar
mv: cannot move `foo’ to `bar’: Operation not permitted
mv -b foo bar
sshfs -o workaround=rename
[...] http://ubuntu.wordpress.com/2005/10/28/how-to-mount-a-remote-ssh-filesystem-using-sshfs/ [...]
Heya.
Sshfs seems the ideal solution for me, but I could not make it work. I have the same problem than Gerard Doets above (comment 64): after mounting, the mount point is not accessible, and shows only quotation marks for uid, gid and access rights. John L. Clark (comment 79) mentionned that the same behaviour is seen when mounting a non-existing file (or one which name was not solved well, such as including ~), but I did check that my file exist, and I give its full path on both machines:
sshfs -o uid=1000,gid=117 me@myserver:home/me/Shared /home/me/Shared
I am under standard kubuntu feisty, installed begining of June 2007. I installed sshfs through dselect, which installed fuse as dependencies. I added myself to the group fuse, and changed by hand the group of /dev/fuse. I can connect between my machines with ssh without any problem.
This is working for me:
sudo sshfs root@192.168.0.199
mountpoint -o uid=1234 -o gid=5678 -o umask=027 -o allow_other
really great, that saves much time for me! now i can use jedit to edit any file on the remote system! better than using the console.
i just googled for remote file editing on linux and landed here (resp. http://www.wynia.org/wordpress/2006/12/19/remote-file-editing-via-sftp-on-linux-and-windows-for-scite/)!
Thanks a lot, very nice
I would like to run an x-server on a separate virtual console (control+alt+f12), open an x-term there, ssh to the server, and start gnome. That should give me access to two different machines on two virtual consoles.
This approach is explained on http://www.linux-tip.net/cms/content/view/302/26/
I tried to follow instructions in this article. I am able to start the x-server but not able to direct an x-terminal to start on it. Would you have a clue?
[...] Ubuntu Blog on wordpress.com [...]
WoW! this went a bit over my head… printing time i think!
Wow, I never knew you could do this; very useful! I’m using it to connect to my mediatemple hosting account. I notice though, that linked directories give it problems.
I’ve just tried to unpack a tar archive via nautilus too, and that’s going veeeeery slowly. I usually scp tar files and unpack them at the command line, rather than ftp a folder with loads of files in, coz it’s much quicker, so handling remote tar/gz/bz2 files in the GUI would be very useful…anyone doing this?
This is very very nice. Thank you for the helpful explanation and thank you to “Konse” for pointing out how to make the entry in the fstab. At some point, I’m going to turn an old laptop into a NAS and this is going to be extremely useful.
I had some trouble with permissions. It appears that apt-get creates the /dev/fuse file (device?) in the root group.
So I did ’sudo chgrp fuse /dev/fuse’ to allow users in the group fuse to access that device.
[...] стаття є стислими перекладом українською чудової статті на сайті [...]
i had mount for other system iam tried to taken backup of mount point some files or copied but some getting this type of error
Tar: couldn’t get uname for UID 112
Hi,
I use Ubuntu edgy 6.12
I installed sshfs like this : sudo apt-get install sshfs
But if now I run sshfs, I have this error :
sshfs: /usr/lib/libfuse.so.2: version `FUSE_2.6′ not found (required by sshfs)
Do you know how could I fix it ?
After mounting with sshfs, I can do read/write stuff in the terminal, but not Nautilus. Any ideas?
[...] I recently discovered sshfs; which is a useful way to mount remote systems via ssh. [...]
I have mutt using Maildirs successfully over sshfs. However I have failed to get procmail to deliver to Maildirs over sshfs.
Someone had asked whether you can do this on a mac. Here is the link:
http://code.google.com/p/macfuse/
> You will have to log out and log in again, to add yourself to the > group “fuse”.
You can also do ’su – $USER’
i have the ? … ??? mark prob as said in comment 103 any solution
Sshfs is great – it has been one of my favorit tools for quite a while. Recently i used autofs in connection with sshfs and that makes it even easier to use since the user doesn’t even have to mount of umount the sshfs file system – it is all done by the sshfs deamon.
I wrote a small article on how to setup autofs and sshfs if anybody is interested: http://www.tjansson.dk/?p=84
called “Autofs and sshfs – the perfect couple”.
[...] ssh: http://ubuntu.wordpress.com/2005/10/28/how-to-mount-a-remote-ssh-filesystem-using-sshfs/ [...]
Not sure if its posted in the above comments but a quick ctrl+f for it didn’t reveal anything so here ya go…
To add a user to a group from the command line I use the following command (Not sure of [code] tag is supported but I'll give it a shot, if not please omit them):
[code]
gpasswd -a
[/code]
This has to be done as root and as long as the command is run properly it should be safe. There is plenty of room for error as well, but if someone is not paying attention at all it is possible to remove entire groups with this command.
HTH!
Matt Schneider
P.S. I thought this might be worth updating your original article. I know that its old, but its otherwise still quite valid and is google's top result for the query "mounting ssh".
wow SSH is the best tool i have ever used! i love the way ssh helps me maintaining my server. I even do web browsing through it, offcourse its in text mod but i enjoy it!
Hey thanks for the post was really useful for me. I used to have a complete home dir NIS setup but wanted to separate the home directory into local and remote due to performance of writing to file. This is the best, now I just symlink my email, chat and widgets config folders to the ssh mounted dir.
hi there.
I need some more help.
I tried like this:
sshfs -p443 myhost.dyndns.org:/tmp /media/sshfs/
which is ok, as I am running ssh on port 443 on the remote machine.
it asks me for my password and then I get:
remote host has disconnected
any ideas whats wrong? what else woudl I need to enable on the remote machine?
also I’d like to know if there is a graphical frontend to scp? something like winscp?
[...] post describes the sshfs in more details and moreover howto use it on Ubuntu and [...]
[...] UPDATE #2 With the instructions above, I still keep having troubles writing data to the dav shares. So if the above doesn’t work right for you, I suggest you try sshfs, for me that works a lot better. Instructions for the use of sshfs with ubuntu can be found here [...]
How ridiculous is this?
If you get the resource busy on fusermount -u, try closing the shell you were on, and using anoter!
Found this by using fuser -u to see what processes were using the mount point. When i killed the process, the shell closed!
Linux rules)))
web based ssh client -
http://www.browsershell.com
[...] There are instructions to get it working on the official website, but ubuntu.wordpress.com has a nice how-to. [...]
I kep getting “connection reset by peer” from either end that I try to connect from, laptop to desktop or vice versa. I followed the instructions to the letter — what is wrong?
I love it! using it right now with my nokia N810 and my slicehost server. sshfs rulez, thx for the tip!
[...] alephsmith] [http://www.wikidot.com/user:info/bzhou" bzhou] anonymous Carthik and others help | terms of service | privacy | report a bug | flag as [...]
[...] and vim. I went searching and found information about mounting the storage space using sshfs in this post on the Ubuntu [...]
oh my god this is beautiful! thank you!
This is awesome because the default ‘Connect to server…’ dialog in Hardy doesn’t mount the drive in /media so you have to access files directly through nautilus. Is there a way to make a shortcut that runs this instead of using a bookmark in nautilus?
[...] on any folder copying only changes, uses hard links, easy to integrate. For remote solution fuse sshfs or avfs (new in Ubuntu Intrepid repos) might help. Or use ssh [...]
I have a HDD connected to my network. I’ll mount it with sshfs in fstab. I want to create an account in several PCs, where the home directory is /media/disk, for example, in order to have access to the same data.
There’s some conflicts with configuration files when I have multiple connections on that account that are trying to write in the same file (like Firefox filesor something like that)?
There’s some way to block permissions for writing on files that are in use?
Any thoughts? Thanks.
[...] but that’s where SSHFS (Secure SHell FileSystem) comes in. With this tool, you can easily mount any remote filesystem over SSH for access by all of your applications. Goodbye [...]
free credit check…
I enjoy reading your blog on neo-neocon ” Blog Archive ” Election Eve open thread. I will surely pop by again….
beautiful, thanks for the tutorial.
Good point there, Thanks again !!!
[...] just follow this tutorial: http://ubuntu.wordpress.com/2005/10/28/how-to-mount-a-remote-ssh-filesystem-using-sshfs/ [...]
[...] General HowTo [...]
finally, thanks for this reference…
Thank’s very much…
sshfs is quite fast as i know
[...] around my network took all of 10 minutes, thanks to sshfs & autofs (helpful instructions here & [...]
[...] Weitere Anleitung zur Nutzung von sshfs unter (Ubuntu) Linux (in englischer Sprache) [...]
Add the ’severin’ user to the group ‘fuse’ is better done with:
sudo usermod -a -G fuse severin