I currently use a script which contains commands along the lines of
sudo /sbin/mount.cifs $SERVER_SHARE $MOUNT -o username=$DOMAIN_$USER,uid=$USER,gid=$USER,file_mode=0664,dir_mode=0775
to mount my cifs shared directories. This works fine, but I have to enter my password for each of these lines, so I would like to automate this process.
In order to adhere to local security policy I must not add my password to the command line, nor may I store my password in plain text in a file (either the mount script or a credentials file).
Do I have any other options for authenticating my cifs mount, or am I stuck entering my password for each and every share?
Ideally I would like the equivalent of doing a
ssh-add, where I only have to enter my password once and all subsequent
ssh commands use that authentication and do not require me to enter my password again.
If it makes any difference, I am using RHEL 5.8 as a normal user with very limited sudo access.