Mounting remote drives on login with Ubuntu Lucid Lynx

Mounting drives with /etc/fstab and referring to an authentication file in the user's home directory is too complicated.
There is a simpler way: create a script that mount drives somewhere in the user's home directory.
I don't know how ubuntu does this but if you do it this way the drives still appear on your desktop. :)

Create this kind of script and make sure it automatically starts via Preferences / Startup applications and you're set!

/usr/bin/sudo /bin/mount -t cifs //mysambaserver/Public /home/user/mnt/public -o username=user,password=xxxxx,noexec

Edit your /etc/sudoers file with visudo:

Defaults visiblepw
user ALL= NOPASSWD: /bin/mount,/bin/umount,/sbin/mount.cifs,/sbin/umount.cifs