If I have in my fstab 10 shares/mountpoints, is it possible to run only a single mount command to mount them all at the same time just to avoid authenticating myself 10 times? I tried something like
sudo mount /mnt/share1, /mnt/share2, ...
etc but with no luck. Authentication is the same (same username, same password) for all the shares I am trying to mount.
Thanks
You can write a script which takes input for the username and password and applies it to each mount required. The script will need to be run with root level privileges. This also assumes that the mounts are all Samba shares. You'd need to tweak the script to include each of your mount points. With this script you will have to define all of your mount options rather than rely on those in
fstab
:Save this script as something like
/home/user/mountall
, and execute it withsudo /home/user/mountall
.This does load your password into memory in plain, and into a variable in the script's running process. Whether that is considered insecure in your environment is a question for your security team.
Command you looking for is probably this:
I'm not sure how the authentication would work with it but give it a try. If it doesn't work you can always edit your fstab entry in this way:
Put your
mount
commands in abash
script, andsudo
that script.