Exiting the system from within a script
Hi, Overview of what I want to do. Allow a user to log on to an account, automatically exuecute a script that will allow them to change there samba password and exit the script, the logout of the account. I do not want them to get a command line. I have done something like this in AIX successfully but I am not sure how to do it in Suse or Redhat. I have a script and at the end of it I want to exit the shell (bash or ksh) then logoff the id. There is no logout command on the box. (Suse 8) Script would be something like trap "" 2 (commands) Allow entry of user id echo ... more ... ./smbpasswd $USRID exit How can I go about doing this. Thanks Dana Jaeger Hartford Hospital Hartford, Connecticut, 06102 jaeger@harthosp.org 860-545-4212 ----------------------------------------------- Confidentiality Notice This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential or proprietary information which is legally privileged. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please promptly contact the sender by reply e-mail and destroy all copies of the original message.
On Tue, 2005-06-14 at 10:34 -0400, Dana Jaeger wrote:
Hi,
Overview of what I want to do. Allow a user to log on to an account, automatically exuecute a script that will allow them to change there samba password and exit the script, the logout of the account. I do not want them to get a command line. I have done something like this in AIX successfully but I am not sure how to do it in Suse or Redhat.
I have a script and at the end of it I want to exit the shell (bash or ksh) then logoff the id. There is no logout command on the box. (Suse 8)
Script would be something like
trap "" 2 (commands) Allow entry of user id echo ... more ... ./smbpasswd $USRID exit
How can I go about doing this.
Add the lines to their .profile file with the last executed command being logout. The are many possibilities. The last place I worked at only gave login users a menu of choices and would not allow them to ^c to break out of the menu. As soon as they exited the menu they were logged off. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
Ken Schneider wrote:
On Tue, 2005-06-14 at 10:34 -0400, Dana Jaeger wrote:
Hi,
Overview of what I want to do. Allow a user to log on to an account, automatically exuecute a script that will allow them to change there samba password and exit the script, the logout of the account. I do not want them to get a command line. I have done something like this in AIX successfully but I am not sure how to do it in Suse or Redhat.
I have a script and at the end of it I want to exit the shell (bash or ksh) then logoff the id. There is no logout command on the box. (Suse 8)
Script would be something like
trap "" 2 (commands) Allow entry of user id echo ... more ... ./smbpasswd $USRID exit
How can I go about doing this.
Add the lines to their .profile file with the last executed command being logout. The are many possibilities. The last place I worked at only gave login users a menu of choices and would not allow them to ^c to break out of the menu. As soon as they exited the menu they were logged off.
Hi Dana, if you don't want to do the above, try "exec exit" instead of just "exit". If the parent process is the login shell, that should do what you want. Martin
participants (3)
-
Dana Jaeger
-
Ken Schneider
-
Martin Deppe