Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a headless server running Ubuntu 12.04.4 that needs to come back up after a reboot without user intervention. There is an existing manual process that involves looking at files on a remote server over sftp and manipulating certain ones. The auth for the sftp site uses a username and password. I want to automate this process by removing the manual step of getting into the sftp server by mounting the remote volume directly on the server that needs the files.

Note that I do not have a ssh identity file because key based auth is not being used. I cannot change the remote end to use key auth; I need to use the existing username and password. Most of the guides I've found out there only deal with using a key based identity file.

Current fstab config:

[email protected]:/SecureFTP /my/localpath fuse allow_other,uid=root,gid=clientfiles,umask=0770

When mounting interactively, it prompts for the password. I need the server to be able to recover from a reboot without having someone there to babysit and type the password in, so it needs to work without any prompting. I don't know how to get the password in aside from the prompt. Ideally, I could specify a credential file with the username and password like I can with the credentials=<file name> cifs option.

I've tried credentials= and password= as mount options but they don't seem to be defined for sshfs; I get fuse: unknown option.

There IS a password_stdin option for sshfs but I'm not sure how that applies in fstab.

share|improve this question
    
Make a ssh key. This has nothing to do with the server. Make a key on the client and then transfer the key to the server with ssh-copyid . Then use a fstab entry with the key ;) –  bodhi.zazen May 28 at 20:27
    
@bodhi.zazen Can't. "Remote execution access has been disabled by the system administrator" –  Chris Smith May 28 at 20:38
    
Why not? I do not think sshfs allows password authentication in fstab. –  bodhi.zazen May 28 at 20:44
    
The remote end may not even be a unixy box with full ssh. It's not under my control. ssh-copy-id fails without remote execution enabled. I asked this question to find some way of making this work... it seems like an oversight if there is no way to do it. –  Chris Smith May 28 at 20:52
    
Contact the owner of the server (remote) box and have a key made for this purpose. –  bodhi.zazen May 28 at 20:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.