Tag Info

Hot answers tagged

11

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 ...


8

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.


8

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 ...


5

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 ...


5

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 ...


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

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 ...


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", ...


3

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 ...


3

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 ...


3

You will need to do a double symlink similar to what /etc/alternatives does on Ubuntu namely: Inside ~ you will have a link: linked_directory -> /<local filesystem>/linked_directory On each of the local machines: /<local filesystem>/linked_directory -> /<actual location>/linked_directory As long as neither /<local ...


3

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 ...


3

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 ...


3

As jw13 pointed out, this is almost an exact duplicate of "ls taking long time in small directory" - at least as far as the explanation is concerned. Make sure to read the comments there too! In a nutshell, some popular command-line programs like ls can operate differently when their output does not go directly to a terminal. In this very case, ls, which is ...


3

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'


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.


2

I haven't checked recently but if any directory in the path to .ssh is world writable SSH would refuse to use authorized keys from it. These permissions could allow other users to fake you .ssh directory. If the home directory is writable by anyone else it will not be used unless StrictModes is turned off.


2

You can use a ssh tunneled pipe: dd if=/dev/sdb2 ibs=1M obs=64k | ssh -C user@remotehost "cat > /path/to/destination" The -C option enables compression in the ssh protocol which usually improves the performance in cases like this. If you have pv installed, you can include it in the pipe to get more information how much already is transferred. dd ...


2

I solved problem. First I created global known_hosts file in /etc/ssh/ssh_known_hosts. Main problem was visible in this line of debug: command: 'pmt-fd0ssh' 'mount.fuse' 'sshfs#pszubert@HOST:' '/home/pszubert' '-oreconnect,idmap=user,password_stdin,nonempty' As we can see there is no space between -o and options. Adding line: ...


2

Symlinks will not help, since they are written to the filesystem -- and so they will always be the same on both machines. However, if your administrator installed bindfs, you can mount different things on both machines. For example, on local, you use sshfs to mount compile:/opt/foo/ with ~/foo/ as the mount point. On compile, you use bindfs to mount ...


2

This sounds like a job for autofs. It's rather adept at handling network mounts of various kinds (nfs, samba, sshfs, you name it) and noticing when those things need re-mounting. It can also takes care of unmounting them after periods of disuse and mounting them when a file system request is made.


2

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 ...


2

Mint (assuming you are using Mint and not Mint Debian) can use Ubuntu repositories. They should in fact be configured by default but they don't seem to be in your sources.list. Add this line to your sources: deb http://packages.ubuntu-com raring main restricted Then run $ sudo apt-get update $ sudo apt-get install sshfs If that doesn't work, download ...


2

The remote files are accessed as the remote user that you logged in as, i.e. root. There's no other way, really. The error you're getting is due to permissions on the local side. It's an oddity in FUSE, which SSHFS is based on. By default, only the user who did the mounting can access a FUSE filesystem. Even root cannot access it. Preventing the root user ...


2

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


1

The method @slm suggested is a good method. If you want to learn another method than it can be done by ssh tunnel also: ssh -t -l gatewayuser -L9997:127.0.0.1:9998 gatewayserver "ssh -l serveruser -D9998 -N internalserver" Kindly ignore the poor diagram :)


1

If I understand your setup correctly, /root/sbin on LX04 is a symbolic link to /usr/local/sbin. Therefore /0/LX04/root/sbin on LX02, which is part of an SSHFS filesystem, is a symbolic link to /usr/local/sbin. When you're on LX02, the directory /0/LX04/root/sbin is located at /usr/local/sbin, and that's the contents you're seeing. Since you're on LX02, you ...


1

Indeed, .bashrc isn't right. That file is read when you open a terminal running an interactive shell (if your shell is bash). You can perform sshfs mounts at boot time, but that only works if you don't need any interactive authentication: in most setups this means a passwordless key. (There are other ways, but they only apply inside trusted networks where ...


1

I don't know if it is enabled or disabled by default, but mkdir can be cached: http://goo.gl/QIW4V (cache_mkdir) Even though the mkdir command itself looks atomic and thread safe enough... http://goo.gl/LC1Ze (sshfs_mkdir) http://goo.gl/NHkNH (sftp_request_send) I would go out on a limb and say that mkdir over sshfs is not atomic, because of the ...


1

The idmap option does not affect permissions, it simply affects shows up in stat() for a file's owner. Also, the uid and gid options only affect the local-side of permissions, who owns the connection effectively. The default_permissions option turns on permission checking on the local side which is probably not what you want. Permissions on the ...



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