goffer
asked on
Script help. Is it possible to login as a user from a script?
I've got a script that runs when a user logs in (Login=modem, which executes script modem which restarts PPP), is it possible in that script after it restarts the PPP to actually login as another user? Basically, the user has to log out and log back in as 'modem' and then log back into their account, I'd like for them to only have to log out of their account and log in as modem which will restart the modem and log them back in to their own account.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Do I need to add both the user ALL=/path/to/modem-script AND user ALL=(modem) /path/to/modem-script? Or is the second if I only want user modem to be able to use sudo /path/to/modem-script?
You have one or the other.
If the modem-script needs to run a a non-root user, say 'modem', then use the second configuration.
If the modem-script needs to run a a non-root user, say 'modem', then use the second configuration.
ASKER
Works great, thank you.
ASKER