Adding new users

ira mendell ibm at bestweb.net
Fri Mar 22 16:01:58 PST 2002


Tush wrote:

> ira mendell wrote:
>
> >useradd -m<newuser> -n<newuser> -p<newuser password> -u<newuser>
> >
> For a new user say tushar:)
> userid=tushar
> grp=users
> homedir=/home/users/tushar
> othergrps=pkgmanager
> uid=1001
> realName="Tushar T"
>
> useradd -c ${realName} -m -d $homedir -g $grp -G ${othergrps} -s /bin/bash -u $uid $userid
>
> The -m creates the home dir and copies the /etc/skel dir.
>
> Let me know if i am missing something.
>
> For more options try "man useradd".
>
> --Tushar.
>
> --
> Unsubscribe: send email to listar at linuxfromscratch.org
> and put 'unsubscribe lfs-support' in the subject header of the message

Thank you for such a quick reply.

    I do see what your getting at but wouldn't  [-m by default create a new directory under
/home ] and   [-n add the group name] and   [-u add the next available id number]  by
default.

   I hope I'm understanding the man pages correctly.
Assuming this is correct I would then have to change the ownerships

ie:    [chown -R <newuser>.<newuser> /home/<newuser>

I'm still having a hard time getting how to change permissions.

I suppose what I'm trying to do is emulate what Redhat does. Based on what I've read through
searching the lfs archives I gather Redhat has adjusted useradd and I think I saw a reference
to mgetty.

I wonder if there's a script that would do basically what they do.
Add a new user, add its passwords create the directories and change the various ownerships
and permissions.

             Ira


-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list