Tag Info

Hot answers tagged

6

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


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

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


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

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

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

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


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

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

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


2

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


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

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.


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

I'm not familiar with sshfs, but I know the 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 ...


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

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


1

Check that in your local machine you have a file ~/.ssh/id_dsa with mode 600 and that the contents of the local~/.ssh/id_dsa.pub are also in the remote ~/.ssh/authorized_keys file. I'm saying id_dsa because it's one of your private keys according to your logs (you also have an identity private key). Maybe you can specify which PrivateKey you want to use in ...


1

sshfs supports specifying the sftp server to use. So copy the normal sftp binary to some path (like the home dir), setuid the binary with chmod u+s, and pass -o sftp_server=/path/to/sftp to sshfs. Example, devuser is the shared account, and myuser is your account devuser@remote # cp `which sftp` ~/ devuser@remote # chmod u+s ~/sftp myuser@local # sshfs ...


1

If you want it to boot without a password, you'll need to create a public/private ssh keys without password. It's not recommendend, but you can at least protect those files with a chmod 400 as root user. After that, as usual, you'll need to copy the public key on the mount point : ssh-copy-id -i my_new_key.pub oli@192.168.0.2 And you'll need to tell ...


1

This can be worked around by decreasing the timeout as suggested here, i.e. add the following to $HOME/.ssh/config or /etc/ssh/ssh_config: ServerAliveInterval 15 ServerAliveCountMax 3 This results in a 45 seconds timeout.


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