I am running a default fedora 15 install. My goal is to have a couple of network drives get mounted right after the user logs in graphically (not via ssh).The script I want to execute is basically just a bunch of mount commands: sudo mount ...; sudo mount ...; sudo mount ...;. I used visudo to let the user have NOPASSWD necessary when doing sudo mount.Where can I put my simple script so that when the user logs in the script will execute?
Default fedora 15 install, how do you get a network drive to mount after login?
fedora;shell script;sudo;login
Firstly, you should not simply allow unfettered access to mount as the superuser using NOPASSWD. You should instead create appropriate entries in /etc/fstab so that the filesystems can be mounted by unprivileged users.If you really want to do this (you don't), you can do this in ~/.bash_profile if the users use bash as their shell, otherwise ~/.profile, or in /etc/profile by evalating $EUID.Again, don't do that. Just add the fstab entries so that an unprivileged user can mount it without elevating.