Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close current shell 1

Status
Not open for further replies.

rzs0502

IS-IT--Management
Nov 18, 2002
708
Hello out there,

I'm trying to close a users current shell from within Python and cannot find a solution.
I've tried os.system("exit")
But system calls a sub-shell.
What I am trying to do is create a 2nd level of authentication on AIX.
If the users 2nd level authentification fails, it should terminate his session completely.
Any ideas?

Thanks in advance...


"If you always do what you've always done, you will always be where you've always been."
 
The trick is to "exec" your python script from the shell, that will make it the top level shell, so when you exit from it you will logout. If the second level auth succeeds, then exec a shell from python, which will then become the top level shell.
 
Thanks Eric,

Works perfectly!


"If you always do what you've always done, you will always be where you've always been."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top