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
/etc/fstab
. Or write a script for which you add a NOPASSWD rule insudoers
. – muru Oct 09 '16 at 17:54