Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to add the PATH of the default for the user where a shell is set in /etc/passwd by /sbin/nologin. I write PATH in /etc/csh.login or /etc/profile,csh in case of bash or csh is OK. What about /sbin/nologin?

share|improve this question
Sorry, what do you want? – Zoredache Nov 26 '09 at 3:03
Yes, would you please rephrase your question? – molecularbear Nov 26 '09 at 4:04
up vote 4 down vote accepted

If you set the shell for an account to /sbin/nologin (on my system it's /usr/sbin/nologin) then if someone tries to login under that account, they will get a message that says the account is unavailable. There is no PATH or /etc/csh.login or /etc/profile for that situation.

This is separate from the /etc/nologin file. If that file exists, no user other than root can login. The contents of that file will be displayed if they try. This is useful when the administrator is about to do a shutdown or otherwise change the runlevel of the system and doesn't want additional users logging in.

share|improve this answer

Using /sbin/nologin will refuse any kind of SSH login for that user. This is useful for service accounts (i.e. apache, mysql) to prevent anyone from using them to login remotely. Typically you could also set a user to /sbin/nologin if they are just an FTP user as well.

share|improve this answer
hi Brent, thanks for the response! But note that we don't allow signature blocks here. Feel free to put it in your user page profile though: – Jeff Atwood Nov 26 '09 at 9:22

Try changing the path in /etc/environment. Put /opt/jdk6.0/bin in front of /usr/bin. However, /usr/bin should be a symbolic link to an appropriate Java version. On Debain or Ubuntu you can use update-alternatives to modify then entry. However, in that case you should consider installing the sun-java package and not run Java from /opt.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.