Topic: Creating a user in NetBSD (for n00bs)

Some UNIX's have a nice script to create new users on the system - this doesn't exist on NetBSD as it's relatively easy to create a user; as I am going to show you.

In this guide, we are going to create a user called "wintellect" who will have su ability.

First we create a default group for our user. It is customary to create a group with the same name as the user themselves:

# groupadd wintellect

That's it, your group is created!


Next we create the user:

# useradd -G wheel -g wintellect -m -s /bin/ksh wintellect

Although this may look complicated, it's quite easy:
-G wheel  =  any additional groups the user is to be part of. wheel group allows su ability
-g wintellect  =  the users default group, we are using the group we already created above
-m  =  create the home directory
-s /bin/ksh  =  the shell the user will have, this can be any shell in /etc/shells
wintellect  =  the final argument is the users name


Finally, we set the users password:

# passwd wintellect
Changing local password for wintellect.
New password:
Retype new password:
"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: Creating a user in NetBSD (for n00bs)

But....what if I don't WANT to name my user and group Wintellect?  smile

Sorry, couldn't resist <ducks and runs>

<@andre> i would be so much more efficient if i wasn't so stupid

Re: Creating a user in NetBSD (for n00bs)

Hehehe!!!

Guru for a day, newbie for a lifetime

Re: Creating a user in NetBSD (for n00bs)

I do feel silly tonight--I could also post, but what if I don't WANT ksh.  And of course,

wintellect  =  the final argument is the users name

Well, yes, that's what we're arguing about. 

Whimsically yours,

<@andre> i would be so much more efficient if i wasn't so stupid

Re: Creating a user in NetBSD (for n00bs)

yay!  I'm glad you rewrote/-posted this, WIntellect big_smile!  I'll certainly use it next time I have to create a user on NetBSD.

Re: Creating a user in NetBSD (for n00bs)

asemisldkfj wrote:

yay!  I'm glad you rewrote/-posted this, WIntellect big_smile!  I'll certainly use it next time I have to create a user on NetBSD.

At least someone appreciates it tongue  big_smile

"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: Creating a user in NetBSD (for n00bs)

zsh

Re: Creating a user in NetBSD (for n00bs)

DaGr8Gatzby wrote:

zsh

what does this have to do with the topic?

For example, Linux had at least two completely independent USB stacks before Linus Torvalds rejected them both and wrote a third one from scratch, after he found both existent Linux  stacks unsatisfactory.  (When pressed for an explanation as to why he selected the API he did, Torvalds stated: "because I wanted to."

Re: Creating a user in NetBSD (for n00bs)

gatzby probably means zsh for user shell , right ?

I'd say bash because it rhymes with...bass wink

Guru for a day, newbie for a lifetime

Re: Creating a user in NetBSD (for n00bs)

is there a specific reason why they haven't ported or made their own adduser script?Its not like its hard to manually create them, just curious...

Re: Creating a user in NetBSD (for n00bs)

I don't think there's a need for it - and a good sys admin would either use the process described in this howto, or write their own adduser script wink

"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: Creating a user in NetBSD (for n00bs)

I was talking about shell....good howto

Re: Creating a user in NetBSD (for n00bs)

how do I get the freebsd in my computer?

http://www.0x743.com/vee (the program formerly known as vii)

Re: Creating a user in NetBSD (for n00bs)

perlfan wrote:

how do I get the freebsd in my computer?

tongue

For example, Linux had at least two completely independent USB stacks before Linus Torvalds rejected them both and wrote a third one from scratch, after he found both existent Linux  stacks unsatisfactory.  (When pressed for an explanation as to why he selected the API he did, Torvalds stated: "because I wanted to."

Re: Creating a user in NetBSD (for n00bs)

thermite wrote:

is there a specific reason why they haven't ported or made their own adduser script?Its not like its hard to manually create them, just curious...

Didn't you know NetBSD is for "real men"? wink

Re: Creating a user in NetBSD (for n00bs)

I have this printed out and use it quite often.  I almost have it memorized now tongue.

Re: Creating a user in NetBSD (for n00bs)

You can also do

#useradd -D -g =uid
#useradd -D -s /usr/pkg/bin/zsh

to set the default group and shell used when doing a useradd. You no longer need to do groupadd before adding a user and this reduces all the future useradd's to

#useradd -m -G wheel kernelpanicked
#passwd kernelpanicked

This is only helpful if you have multiple users on your machine.

Last edited by KernelPanicked (2005-06-21 00:40:28)

... and then they said "I bet you can't make MINIX kernel panic!!!" And that's when I got mad

Re: Creating a user in NetBSD (for n00bs)

thanks KernelPanicked!

Re: Creating a user in NetBSD (for n00bs)

I have this tacked on my wall now smile.

http://img.photobucket.com/albums/v346/ … _howto.jpg

Re: Creating a user in NetBSD (for n00bs)

you're so cool asemi !

<wintellect> NetBSD users are smart enough to accept that there's no 3D support tongue

Re: Creating a user in NetBSD (for n00bs)

I don't see why something this trivial should be posted on the wall. neutral

Re: Creating a user in NetBSD (for n00bs)

because I do it so often and somehow still don't have it memorized.

Re: Creating a user in NetBSD (for n00bs)

*nix users are masochists.

$ gcc -Wall Kuno.c -o Kuno
Kuno.c: In function 'main':
Kuno.c:5: warning: unused variable 'Life'

Re: Creating a user in NetBSD (for n00bs)

*snore* useradd is a simple utility. It doesn't require a piece of paper to operate. Just your memory and the manpage.

Oh yeah, Fuck bash & zsh.

Last edited by emacsen (2006-02-25 21:13:07)

Re: Creating a user in NetBSD (for n00bs)

emacsen wrote:

*snore* useradd is a simple utility. It doesn't require a piece of paper to operate. Just your memory and the manpage.

Oh yeah, Fuck bash & zsh.

I don't feel like reading the manpage every time I use useradd, and WIntellect's howto has been immensely helpful to me (even though it would only take me about a minute to write down all the steps myself from the man page tongue), and I simply wanted to show my appreciation, and show how often I consulted the howto in hard copy form (which is easier for me than looking through the man page to remind me of the flags).  no need for the hostility! smile