Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.