Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 10-27-2008, 08:57 AM   #1
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Rep: Reputation: 40
Using /bin/false shell on Red Hat systems


I can't seem to find any good documentation on what exactly using /bin/false as a users shell implies. Does anyone know this?

I need to create a user which can authenticate (using a third party software) but not log in. Using /bin/false as a shell for that user seems to do the trick, but I'd like to understand the use of /bin/false.

And how does /bin/false differ from /sbin/nologin?

Old 10-27-2008, 09:12 AM   #2
Registered: Jul 2008
Location: Russia/Siberia/Krasnoyarsk
Distribution: SuSE, CentOS, FreeBSD
Posts: 77

Rep: Reputation: 21
In brief: /sbin/nologin refuses login with a corresponding message, /bin/false just does nothing and returns 1. You should simply read their very short man pages.
Old 10-27-2008, 09:14 AM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Well, on my machine, /bin/false is program that appears to do nothing. It's a binary so, to see exactly what it does, you'll need to get the source code.

And this from the man page:
       false - do nothing, unsuccessfully
       false [ignored command line arguments]
       false OPTION
       Exit with a status code indicating failure.
So, if it does nothing unsuccessfully, does that mean it actually did something? No wonder they say programmers are weird.....

Seriously, what I take away is that a user logging in who is assigned "false" as his/her shell is politely informed that he/she cannot run a shell.
Old 10-27-2008, 11:38 AM   #4
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Original Poster
Rep: Reputation: 40
Ah, I didn't find the man pages at first, but now I did.

I came across which describe /bin/false as a non-secure feature for use as a shell. It's definately worth a read.

And for my problem, I'm going for creating a regular user, but preventing SSH login in sshd_config.

But thanks for the advice anyways!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SUSE - Root Shell accidentally set to /bin/false LinuxBaby Linux - Server 7 02-21-2008 10:50 AM
QLA2462 dual port 4Gb/s FC HBA, Red Hat EL 4 update 4 hardware false detect stvy Linux - Enterprise 2 03-22-2007 09:45 AM
java bin on red hat chidomen Linux - Software 3 01-12-2005 09:22 PM
Stupid mistake - changed root shell to /bin/false Kholnuu Linux - General 8 01-04-2005 04:48 AM
Red hat file systems alexr186 Linux - Software 5 10-10-2003 07:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration