0

In order to pass a password in a shell script you will have to write:

sudo mount -t cifs -o password=asdasd,username=mc007,uid=1000 //192.168.1.105/cfmaster/ /PMaster/projects/x4mm/win

But there are situations you don't want to use sudo (build-scripts,...).

And so if you don't use sudo, the command will abort with:

only root can use "--options" option

Now, how can one mount network share with password from within a non-interrupting shell script?

thanks

edwinksl
  • 24,109
xamiro
  • 563

1 Answers1

0

As mentioned in the comments, user 'muru' suggests to look at How do I run specific sudo commands without a password?. After researching it seems the only official supported way to mount a password protected windows share from within a script.

It needs you to be a tech savy, and it needs you to alter system files with root permissions.

xamiro
  • 563