Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Reviewing an /etc/passwd file on an ftp server, there are quite a few accounts that are used for ftp only access, yet their shell in passwd shows as /bin/bash rather than /sbin/nologin.
If they are only using the accounts to FTP to the server, changing the shell shouldn't cause any issues even though they've been using it like this for a while, right?
nologin is used to disable logins, I believe ftp will also respect that, but it depends on the ftp service. At least one ftpd server doesn't care what the shell is, as long as it is in the /etc/shells file.
One entry that shouldn't cause a problem is changing the users shell to /bin/true (or false for that matter). You do need to add whichever one to the /etc/shells list so that it is considered a valid shell.
What using /bin/true (or /bin/false) does is to just exit when the user tries to login with a shell connection, so even if the user gets logged in, they get logged out immediately.
Try using /sbin/nologin and see if it works for you. If it does (and doesn't block ftp logins) go with it.
so I guess i'll try it with one user and see what happens, I was just curious.
The only difference I can find between /sbin/nologin and /bin/false, is that nologin writes a message to the user "This account is currently not available", and can display the contents of the file /etc/nologin.txt.
The /etc/nologin.txt should disable ftp - it should have the reason logins are being disabled, but can be empty. I've used it to tell users the system is unavailable due to maintenance, and tell them when the system is scheduled to return to service. It is normally created automatically during shutdown so users will stop trying to login at the beginning of a timed shutdown.
Yes. /bin/false is a utility that is sometimes built into shells, but is also provided externally. All the true/false utilities do is set the exit status to 0/1 (and yes, this is not directly obvious: 0 as an exit status is a "successful exit" and 1 as an exit status is an "error exit").