LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-27-2008, 07:57 AM   #1
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

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


Hi.


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?


Regards,
kenneho
 
Old 10-27-2008, 08:12 AM   #2
allez
Member
 
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, 08:14 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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:
Code:
NAME
       false - do nothing, unsuccessfully
SYNOPSIS
       false [ignored command line arguments]
       false OPTION
DESCRIPTION
       Exit with a status code indicating failure.
<snipped>
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, 10:38 AM   #4
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

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

I came across http://www.semicomplete.com/articles/ssh-security/ 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!
 
  


Reply



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 09: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 08:45 AM
java bin on red hat chidomen Linux - Software 3 01-12-2005 08:22 PM
Stupid mistake - changed root shell to /bin/false Kholnuu Linux - General 8 01-04-2005 03:48 AM
Red hat file systems alexr186 Linux - Software 5 10-10-2003 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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