Re: useradd command difficulties

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: keith smith
Date:  
To: Main PLUG discussion list
Subject: Re: useradd command difficulties
Hi John,

Thanks for the pointers.

I've remove the /public_html

I did notice I had to change the password to be able to connect with FTP - thanks for clearing that up.

Was not familiar with /bin/false for a no shell user. - thanks for that one.

I did create a directory /etc/skel_no and am using the -k argument. I did this because I did not what the default files to be uploaded to the user's home dir.

Thanks for the pointer on adding the plublic_html directory to the skel dir so it will be automatically created off the user's home dir. In my case I will add it to /etc/skel_no dir.

All that is left is to chown the public_html dir.

Thanks a bunch. You really cleared it up for me.

Thank,
Keith

John Seth <> wrote: Hey there,

You'll probably want to change your line from:
useradd -d /home/klsmith03/public_html -m - g ftpuser -p test03 -s
/bin/ftp klsmith03

to:

useradd -d /home/klsmith03 -m - g ftpuser -s /bin/false klsmith03

Reason being is that -d is the user's home directory,
/home/klsmith03/public_html won't be created if /home/klsmith03 doesn't
exist. "-s" is the shell, /bin/ftp is not a shell, and honestly I
don't know what'd happen if you had that there. /bin/false or
/bin/nologin, depending on the linux distro is the way to go if you want
to create a user, without a shell. Also, don't specify -p for a
password, as it will create a plain text password. Another suggestion,
is that if you want "public_html" to be created on account creation, add
it to /etc/skel, the -m will add anything in /etc/skel to a newly
created account.

My suggestion for creating an FTP only user would be the following:

(add specific directories to /etc/skel for new accounts)
useradd -d /home/klsmith03 -m - g ftpuser -s /bin/false (or
/bin/nologin) klsmith03
passwd klsmith03 (enter password when prompted)
(set ftpserver permissions to lock user into the directory of choice,
if your ftpd supports it)

Hope that helps,


Tony Evans
Phoenix Wing Interactive

http://www.phoenixwing.com/




keith smith wrote:
> Hi Everyone.
>
> Still working on that VPS w/o a control panel.
>
> Got the FTPD server up and running.....
>
> Now I am trying to add a user, defining the directory & no shell.
>
> User        : klsmith03
> Password : test03

>
> After much research I came up with the following command.
>
> useradd -d /home/klsmith03/public_html -m - g ftpuser -p test03 -s
> /bin/ftp klsmith03
>
> I get error : useradd cannot create directory /home/klsmith03/public_html
>
> I googled and found some others are having the same problem. The
> answer on every post was to add the -m argument. As you can see I
> have the -m argument in my command.
>
> I've moved the -m argument around but I still get the same error message.
>
> Any help much appreciated
> Keith
>
>
>
>
>
>
>
> */
> /*
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com ---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss