Unusual login requirement

Micheal Patterson micheal at tsgincorporated.com
Tue Apr 13 22:10:46 PDT 2004

----- Original Message ----- 
From: "Doug Hardie" <bc979 at lafn.org>
To: <freebsd-questions at freebsd.org>
Sent: Tuesday, April 13, 2004 11:12 PM
Subject: Unusual login requirement

> I am trying to figure out how to implement an unusual login requirement
> and haven't found a good approach yet.  What I need is to have a
> specific user id that when it is logged in it executes a specific
> script and then immediately logs out.  Basically what it needs to do is
> run a make that builds a CD from a bunch of files and then burns the
> CD.  Obviously a blank CD would need to be in the burner first.  I
> don't want a general login as this would be used by a person who should
> not have access to the system.  I just need him to be able to burn a CD
> frequently.
> My first throught was to create a script and set it as the shell in the
> passwd file and add it to /etc/shells.  Is that the best approach?  I
> am not concerned about the user breaking out of the script as he is
> trusted.  I just don't want to create a regular user account for him.
> The server is running FreeBSD 4.6.  Thanks,
> -- Doug

If you use bash, you can create your script, start it in the .profile and
have exit directly below it. That way, when the script finishes, it will
exit out. Also, even though this is not a concern for you, this is a
safeguard should they break out of the script, it kills the session too.


Micheal Patterson
Network Administration
TSG Incorporated

More information about the freebsd-questions mailing list