how can i run a shell scripts (or a number of commands )when a user logs in to a linu
hi all , i amtrying to configure samba on mandrake 9.1 which wil share files from winxppro machine.i amusing smbmount for the perpose and can mount windows directories on muy linux machine.but now i want to run all those smbmount commands for a user automatically when that perticuler user logs into the linux machine.
i belive someone can help me doing this. thanks in advance |
Put those command in: ~/.bash_profile, ~/.bash_login, or ~/.profile whatever is most apropriate for your distro and login shell.
|
thanks a lot.i am trying that and let u know what happens.but i am not getting one thing that is, all those commands generates a password: prompt where the user need to provide password.what will happen if i run it automatically.how i cn the script/commands be answared automatically.
|
I've never used samba, but maybe this works:
echo "password" | smbmount bla bla Note that it is quite insecure storing password in a script. At least check that group/other have no reading and execute rights on the script! |
If you are going to put the password right in the script like that, you could just as well do this for the mount portion:
Code:
mount -t smbfs -o username='DOMAIN\username',password=password \ |
All times are GMT -5. The time now is 06:20 PM. |