Take the 2-minute tour ×

I am trying to mount network data. This works if I enter the following commands into the shell:

cd ~
sshfs user@ssh.company.com:/ /home/userName/remoteWork

If I however, put those commands in a script and try to run it, it does not work. I am prompted for my password, it seems to accept it, but the mount doesn't happen. Why wouldn't the commands work from a script? Must I add commands?

share|improve this question
Anything in the logs? –  Dennis Williamson Sep 25 '10 at 2:57
Have to ask - how are you determining the mount didn't happen? The command operates silently so personally I use df -h afterwords to verify it. –  hotei Sep 25 '10 at 3:02
You tagged this as "automount" - whose userid is running the script you mention? –  hotei Sep 25 '10 at 3:08
I'm not sure where the logs are but perhaps the df -h was the command for the logs, and after I changed permissions to 755 it seems to work (as seen in the logs and testing), even though I could have sworn I had made it executable. Thanks for the help guys, I know that was a silly mistake. –  D W Sep 27 '10 at 17:24
add comment

1 Answer

up vote 1 down vote accepted

Your first command to cd ~ is not required but that's not a problem.

I just tried exactly the same commands in a shell script (bash) and it worked. It may be obvious, but the path /home/userName/remoteWork must already exist and have perms that allow you to use it - say your userid with 755 perms.

share|improve this answer
add comment

Your Answer


