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:
sshfs#username@secureftp.example.net:/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.