Hot answers tagged

49

I believe you need use the allow_other option to sshfs. In order to do this, you should call it with sudo, as follows:- sudo sshfs -o allow_other user@myserver:/home/user/myprojects ~/mount/myprojects Without this option, only the user who ran sshfs can access the mount. This is a fuse restriction. More info is available by typing man fuse. You should ...


31

You can run sshfs with the "reconnect" option. We use sshfs with PAM/automount to share server files for each workstation in our network. We use -o reconnect as parameter for sshfs, mostly because our users suspended their computers and on wake sshfs would not reconnect (or respond, or anything). For example: sshfs ...


27

Here's what works for me: sshfs me@x.x.x.x:/remote/path /local/path/ -o IdentityFile=/path/to/key You can figure this out via man sshfs: -o SSHOPT=VAL ssh options (see man ssh_config) man ssh_config IdentityFile Specifies a file from which the user's DSA, ECDSA or DSA authen‐ tication identity is read.


16

A better solution might be to add the user to the fuse group, i.e.: addgroup <username> fuse


12

Given the message failed to open /etc/fuse.conf: Permission denied, I suggest chmod a+r /etc/fuse.conf


8

This can be worked around by decreasing the timeout. Add the following to $HOME/.ssh/config or /etc/ssh/ssh_config: ServerAliveInterval 15 ServerAliveCountMax 3 This results in a 45 seconds timeout.


8

Key-based authentication can only work if the ssh process can find your key. You presumably have your key in your home directory; but you've never told sshfs where to look for a key. At boot time, it would be root mounting all filesystems, therefore the key must be either in /root/.ssh or referenced in /root/.ssh/config. I recommend mounting the filesystem ...


8

sshfs uses the SSH File Transfer Protocol (SFTP). The workaround that you have enabled is working around the semantics of a rename() operation over that protocol when the "new" name already exists. The POSIX behavior for rename() in this case is to remove the existing file and complete the rename. In the SFTP protocol, you can rename a file with the ...


7

SysV Init The /etc/init.d/mountall.sh init script mounts local filesystems only: mount -a -t nonfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs,gfs2,ceph -O no_netdev Other filesystems are mounted by separate init scripts, like for example /etc/init.d/mountnfs.sh, which declare (via LSB headers) their dependency on $network. Thus these get scheduled later, ...


6

Like many editors, Sublime saves to a temporary file, then moves that temporary file into place. It's done this way in case the system crashes during the save: it's guaranteed that either the original file or the new version will be present, you don't risk losing the file. SSHFS is built on top of SFTP, which (at least as implemented by OpenSSH) does not ...


6

If you're using sudo then you're likely using root's credentials to mount, which I do not believe is what you want. I wouldn't probably do what you're asking, wrt. mounting to /mnt as user1 and acessing as user2. It's going to get complicated with groups & user permissions. If you truly want to mount a directory to /mnt to share then you really should be ...


6

I'm not familiar with sshfs, but I know the nobootwait option works for local disk partitions. Maybe try: sshfs#ecarroll@o99:/opt/dealermade/ftp/inc /opt/dealermade/ftp/inc fuse defaults,idmap=user,users,nobootwait 0 0 (A quick google search also shows archlinux uses nofail as per this thread. A little more googling shows that nobootwait might be a ...


5

What you need to do is specify which private key to use in the .ssh/config file like this: Host server1.nixcraft.com IdentityFile ~/backups/.ssh/id_dsa Host server2.nixcraft.com IdentityFile /backup/home/userName/.ssh/id_rsa


5

Mount your network location with whichever protocol you're using: # smbfs example: mount -o username=your_hetzner_username //server.or.ip.addr/sharename /mnt/server-mountpoint Create an ext2fs image (or another filesystem, if you prefer) inside a file on that share. Do this only the first time, as it wipes the data in backup-fs.image: # create a 1000 MB ...


5

This should be a comment to mrb's answer. But I am not allowed to add comments, so adding this as another answer. We can use the following dd command for the 100GB image creation to save some time. dd if=/dev/zero of=/mnt/hetzner_backup/backup-fs.image bs=1024 count=0 seek=$[1024*1024*100] This finishes in a fraction of a second, while the one in mrb's ...


5

If the remote directory is mounted, it will be listed in the output of mount. That contains most of the information you need: $ mount -t fuse.sshfs terdon@123.456.7.8:/remote/path/dir/ on /home/terdon/foo type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1001,group_id=1001) With that in mind, you could write a little script that parses the output and ...


4

Seems like the server does not want to allow it based onthe output of auth.log. I'd try adding arcfour back into the SSH server's sshd_config file. From the sshd_config man page: excerpt Ciphers Specifies the ciphers allowed for protocol version 2. Multiple ciphers must be comma-separated. The supported ciphers are “3des-cbc”, ...


4

sshfs cannot handle block devices. It will treat everything as a file. You would need to get creative with ssh, dd, and command line redirection like so: PC2 -> PC1: dd of=/home/Alan/Desktop/image.iso < ssh root@PC1 "dd if=/dev/sdb" or from PC1 -> PC2: dd if=/dev/sdb | ssh root@PC2"dd of=/home/Alan/Desktop/image.iso"


4

To answer your question directly dd if=/dev/sdb2 ibs=1M | ssh -C myServer 'dd of=/path/to/destination obs=1M' For bonus you can do the following to see the progress (assuming you have the pv utility) pv /dev/sdb2 | ssh -C myServer 'dd of=/path/to/destination obs=1M'


4

Unfortunately, that is not possible with -o. The list of ssh options supported by sshfs can be found in the source code: static const char *ssh_opts[] = { "AddressFamily", "BatchMode", "BindAddress", "ChallengeResponseAuthentication", "CheckHostIP", "Cipher", "Ciphers", "Compression", ...


4

You can use the ProxyCommand you can setup ssh so that it will connect to a "gateway" system and then connect to a secondary system that's behind the "gateway" system. Host internal-host User sam IdentityFile ~/.ssh/id_rsa ProxyCommand ssh user@gateway nc internal-host.somedom.com %p This technique makes use of the tool nc to act as a ...


4

THe SSHFS filesystem is built on top of the SFTP protocol. SFTP provides only facilities to manipulate files in “classical” ways; the client makes a request to the server (list a directory, upload a file, etc.), and the server responds. There is no facility in this protocol for the server to spontaneously notify the client that something has happened. This ...


3

I think you're describing autofs. Autofs mounts filesystems on demand, that is, when you try to access them. According to this Arch wiki page, it should work with sshfs. https://wiki.archlinux.org/index.php/autofs#FTP_and_SSH_.28with_FUSE.29


3

What we do in my team is use puppet to control this sort of file with the config stored in a subversion repository. Each person checks out a copy of the repository to their local machine, uses their favoured editor to make changes and then commits the change. The changes are automatically applied to the live machines by puppet (which runs with admin privs). ...


3

I don't think it's mapping to marigold. The GID that marigold is using on your local system is the same number as the default group of 100py on the remote server devcoder01. For example On my laptop my default group is GID 501, saml. $ id -a uid=500(saml) gid=501(saml) groups=501(saml),502(vboxusers),503(jupiter) On my remote server skinner the user sam ...


3

The remote host sees nothing but the (encrypted) reads and writes to the file.


3

Try chucking in the two following options -o idmap=user,uid=<YOUR UID>


3

Use ssh-agent to store the key, then sshfs can use the key from the agent without asking for the passphrase. - Of course you now need to supply the passphrase to add the key to the agent. - mate-keyring might help you with this.


3

If the filesystem is already mounted and you need to change the mount options, you must remount the filesystem. You can either umount then mount or you can use the remount option to mount. Here is an example: mount -t sshfs -o remount,allow_other foo:/bar /some/path


3

After a lot more of trying it turns out my client user wasn't in the fuse group. After I added it with sudo usermod -a -G fuse myuser the mount works fine again. Don't ask me how it could have worked before reinstalling the server. Thank for all your help!



Only top voted, non community-wiki answers of a minimum length are eligible