How to create limited user accounts in Linux

Posted by James Willson on Super User See other posts from Super User or by James Willson
Published on 2012-09-20T14:44:09Z Indexed on 2012/09/20 15:41 UTC
Read the original article Hit count: 264

Filed under:
|
|
|

I want to create a user account for each of the key programs installed on my debian server. For example, for the following programs:

Tomcat Nginx Supervisor PostgreSQL

This seems to be recommended based on my reading online. However, I want to restrict these user accounts as much as possible, so that they dont have a shell login, dont have access to the other programs and are as limited as possible but still functional.

Would anyone mind telling me how this could be achieved? My reading so far suggests this:

echo "/usr/sbin/nologin" >> /etc/shells useradd -s /usr/sbin/nologin tomcat

But I think there may be a more complete way of doing it.

EDIT: I'm using debian squeeze

© Super User or respective owner

Related posts about bash

Related posts about security