I have a network share I mount on a Linux-computer using the following command:
sudo mount -t cifs -o credentials=/path/to/credentials,uid=1000,gid=1000,file_mode=0600,dir_mode=0700 //192.168.6.9/myshare /where/to/mount
I open KDE Konsole, run this command, enter my password and the share is mounted successfully. Everything works just fine. So I thought a graphical prompt for my password would be nice. A bit of googling and I ended up with the following command:
MY_PASSWORD=$(kdialog --password "Give me your password")
The question is, how can I "feed" this password in
$MY_PASSWORD to the
sudo mount ...-command? In other words, how can I avoid having to type the password in Konsole after running
sudo mount ... and instead automatically read it from said variable?