[CentOS] Users

Tue May 5 06:15:32 UTC 2009
Daniel_Curry at Dell.com <Daniel_Curry at Dell.com>

If adding several users, you may want to try something such as:

for (( i = 0; i <=100; i++ )); do echo $1; adduser student$i; echo
"password" | passwd --stdin "student$i"; done

Of course, modify the for loop if you just need to add a few specific
named accounts.  I used this one for a school setup.

Alternatively:

# adduser steve; echo "steve's_password" | passwd --stdin "steve"

Will create a single user (steve) and assign the given password within
quotes.  It is an easy command string to alias, as well.

Daniel



-----Original Message-----
From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On
Behalf Of nate
Sent: Monday, May 04, 2009 11:35 PM
To: centos at centos.org
Subject: Re: [CentOS] Users

Jason Todd Slack-Moehrle wrote:
> Hi All,
>
> I am confused about users. IIRC, ftp users are just ordinary users on
> the system (/etc/passwd)
>
> Is there an add user wizard from the command-line?

Quick way is typically:
adduser <username>
passwd <username>

> I dont quite get all of the steps to add a user, dont let login except
> FTP, etc, etc

Here I would run:
chsh <username>

and set it to something like /sbin/nologin or /dev/null, this will
prevent someone logging in through ssh/telnet etc. Some ftp servers
will also prevent you from logging in as well, depends on their
config. Debian Linux's 'adduser' command is more wizard like, I'm
not aware of anything myself on the CentOS side that is similar:


vmware2:~# adduser testme
Adding user `testme' ...
Adding new group `testme' (1002) ...
Adding new user `testme' (1002) with group `testme' ...
Creating home directory `/home/testme' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for testme
Enter the new value, or press ENTER for the default
	Full Name []: test account
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
Is the information correct? [Y/n] y

Similar to add a user to a group: adduser <username> <groupname>

Which is pretty easy, I think in CentOS/RHEL the main way to do this
is using the 'usermod' command(I usually just edit the group file
by hand..)

Or you could use a ftp server that maintains it's own user database,
I think servers like proftpd and pureftpd have the ability to use
an external dedicated user database and not rely upon system
authentication. It depends on what you need the ftp server for, if
the users are uploading content for a web server or something or
if it's just for basic file storage.

nate


_______________________________________________
CentOS mailing list
CentOS at centos.org
http://lists.centos.org/mailman/listinfo/centos