Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .