Download your favorite Linux distribution at LQ ISO.
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 03-12-2004, 09:05 AM   #1
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 459

Rep: Reputation: 30
adduser but no shell and no home dir

I would like to setup a user strictly for FTP, so I do not want them to have access to a shell nor do I want them to have a home dir. I know the GUI in RH9 allowed me to do this but how can I from a CLI (command line) in Mandrake9.2?

And yes, I did RTFM.

The GNUbie
Old 03-12-2004, 09:47 AM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Try this something like this..

useradd -g ftpusers -d /dev/null fred
Old 03-12-2004, 10:21 AM   #3
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 459

Original Poster
Rep: Reputation: 30

looks like its still letting me ssh in...

Could not chdir to home directory /dev/null: Not a directory
-bash: /dev/null/.bash_profile: Not a directory

any other suggestions?
Old 03-12-2004, 10:42 AM   #4
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 459

Original Poster
Rep: Reputation: 30
for the next guy
Old 03-12-2004, 01:40 PM   #5
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
set the login shell to /bin/false
Old 03-12-2004, 02:21 PM   #6
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
I had the same problem...still haven't resolved it. Even WITH all the correct options for useradd it just adds the user, no home directory or anything.
Old 06-14-2011, 11:54 PM   #7
LQ Newbie
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
How can i create any user without making directory in home??? any one can suggest me??
Old 09-05-2011, 10:52 AM   #8
LQ Newbie
Registered: Sep 2011
Location: Teesside
Distribution: Ubuntu
Posts: 3

Rep: Reputation: Disabled
Saminur.. I recently used the command

root@testsvr:~# useradd -g testgroup -d /dev/null -s /dev/null testuser2

to create a user "testuser2" in the group "testgroup" with no shell access or home directory. Technically the command assigns /dev/null to be the home dir. It also assigns the shell as /dev/null. There are lots of posts around saying to use /bin/noshell as the shell but I feel happier using /dev/null and its always worked fine for me. (/dev/null is can be thought of as a blackhole in linux, anything sent to it vanishes!)

To allow this account to be used for anything, ftp etc you will need to give the user a password by issuing the command

root@testsvr:~# passwd testuser2

then entering and confirming the password.

Hope this helps, this works on Ubuntu but should work on most if not all distros as far as im aware.


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
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 08:54 PM
I have an nfs mounted /home and 'adduser' fails to create a new user dipukm Linux - Software 4 06-01-2004 07:38 PM
How can I define permissions on a /home/user dir _before_ creating it with adduser skunkburner Linux - General 6 03-18-2004 04:42 PM
Apache Home Dir Nige General 1 02-24-2004 05:10 PM
Create public_html dir during adduser MikeeX Slackware 5 06-24-2003 03:20 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:02 AM.

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