Quote:
Originally Posted by rakrr786
i am a newbee and i need to write a shell script that will give the root access
|
That is a highly questionable combination of things.
Quote:
Originally Posted by rakrr786
is there a way to check the user is logged in and
|
Parse /var/log/secure contents for username?
Parse 'last' information for the same?
Make pam_script or another PAM module perform some test on login?
Quote:
Originally Posted by rakrr786
then start the counter for say 3 hours
|
'echo doSomething|/usr/bin/at "now + 3 hours"'?
Quote:
Originally Posted by rakrr786
the user will be automatically removed from the superuser group
|
..yeah, but you don't realize that once a user gains root privileges all bets are off as root can modify about anything. Investigating limiting privileges via the use of Sudo would be a better start.