LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-12-2004, 08:05 AM   #1
ryedunn
Member
 
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.

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

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


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

Original Poster
Rep: Reputation: 30
well

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
-bash-2.05b$

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

Original Poster
Rep: Reputation: 30
for the next guy

http://www.linuxnetmag.com/en/issue7/m7secureftp1.html
 
Old 03-12-2004, 12:40 PM   #5
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
set the login shell to /bin/false
 
Old 03-12-2004, 01:21 PM   #6
Komakino
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, 10:54 PM   #7
saminur@ymail.com
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, 09:52 AM   #8
SothebyIT
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.
 
  


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

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

All times are GMT -5. The time now is 06:58 AM.

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