Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
1  
Sorry, what do you want? –  Zoredache Nov 26 '09 at 3:03
1  
Yes, would you please rephrase your question? –  molecularbear Nov 26 '09 at 4:04

3 Answers 3

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: serverfault.com/users/27299/brent-frye –  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

 
discard

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.