1833875 Members
1749 Online
110063 Solutions
New Discussion

User login question

 
SOLVED
Go to solution
Craig A. Sharp
Super Advisor

User login question

SA's.

I have an account that is a general account with a password.
I need to prevent logins to this account but also keep the password. The software that will use the account needs access but no user access.

Any suggestions on how to do this?

Thanks,

Craig A. Sharp
Unix Systems Administrator
Roush Industries, Inc.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: User login question

Craig:

If I understand the need correctly, you want an account setup to which a user "logs-in" but in doing so can only execute a particular application. There are two simple ways to do this:

1) As the last entry in the $HOME/.profile, 'exec' your script or application. To prevent "shelling" out during the processing of the .profile place the following trap at the profile's beginning:

trap "" 1 2 3
# ...main profile
exec # ...end of profile

This method gives you the advantage of setting up whatever environmental variables you need or want.

2) In lieu of the above technique, declare the application or script in the /etc/passwd file in place of the normal shell (the seventh, colon-delimited field).

...JRF...
Craig A. Sharp
Super Advisor

Re: User login question

James,

Excellent reply, I can use it elsewhere.

What I need to do is disable any logins to the account but leave the account and password intact.

Craig
James R. Ferguson
Acclaimed Contributor
Solution

Re: User login question

Craig:

OK, then replace the login shell in /etc/passwd (for the account in question) with "/usr/bin/false".

...JRF...