This is a deliberate change in behaviour (source):
As of Ubuntu 11.10, update-manager no longer prompts for the user's password to apply updates. This was decided to improve usability and to make it easier for users to apply security updates and therefore increase system security. The rationale is as follows:
Like in previous releases, by default only people in the admin group are allowed access to perform security updates.
Only updates for already installed software can be applied without a password. Installing additional software still requires people to enter their password.
The password prompt had become an irritant for some people such that they would just press 'Cancel' instead of installing the updates. The password prompt decreased system security for those users.
People that did dutifully apply updates became conditioned to enter their privileged password perhaps daily. When the user is prompted for the password, it should mean something and the frequency of update-manager updates meant that some people no longer thought about why they were entering their password. For these users, the password prompt had the potential to reduce security.
For environments where this change is deemed not appropriate, this functionality can be disabled by the administrator via PolicyKit or by creating users that are not in the admin group (a recommended practice to begin with).
The relevant PolicyKit policy is in the file /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
:
[Update already installed software]
Identity=unix-group:admin
Action=org.debian.apt.upgrade-packages
ResultActive=yes
This grants permission for anybody in the admin group to update packages without having to enter a password. I've never used PolicyKit before now, but based on my reading of the manpage for pklocalauthority, to override this you should create a this file..
/var/lib/polkit-1/localauthority/50-local.d/require-password-to-update.pkla
you'll need superuser priviledges to create it, so use this command...
gksudo gedit /var/lib/polkit-1/localauthority/50-local.d/require-password-to-update.pkla
which will open a new file in gedit and put the following policy entry in it:
[Require password to upgrade already installed software]
Identity=unix-group:admin
Action=org.debian.apt.upgrade-packages
ResultActive=auth_admin
Save this and exit gedit, you can now open update manager and it will ask you to confirm your password before applying any updates.
Okay, I managed to solve this on my own (with the help of others). The underlying problem was, as I suspected, the fact that I was trying to run a command that required root privileges without supplying a password. I solved this problem by following the instructions in the thread "How do I sudo a command in a script without being asked for a password". The long and short of it is, I created a shell script called "script-mount-samba-share.sh" that contains nothing other than a single line with the mount command that I want to run:
mount -t cifs //centaroo.local/Me /media/Me -o uid=scott,gid=scott,credentials=/home/scott/.smbcredentials,iocharset=utf8,sec=ntlm,file_mode=0600,dir_mode=0700
Then, I changed the file's ownership to root:root and changed its permissions to 700. Next, I set up sudo to allow running that script without entering a password, and then I changed the "Command" field in Startup Applications Preferences > Edit Startup Program to "sudo /home/scott/script-mount-samba-share.sh" (without the quotes), and voila. Next time I rebooted and logged in with my user, the Samba share mounted without my lifting a finger. I also tested that when I reboot and log in with a different user, the Samba share does not get mounted, which is what I want.
The only minor catch that I'm now trying to overcome is, when I'm already logged in and then switch users to someone else, my Samba share still shows up in the left hand nav bar in Nautilus, which makes sense as it was mounted when I logged in with my own user, but I don't want the mounted share to display in Nautilus for the other user, so my next task is to figure out how to make that part happen.
Best Answer
TrueCrypt asks you for a password because mounting a filesystem requires superuser privileges. Do not circumvent it by allowing to run
truecrypt
as root without password, this is insecure as a malicious script can get elevated privileges by mounting a special-crafted container, and gain root privileges from it (e.g. setsuid binaries on in an ext2 filesystem or mounting on/
).