User Tools

Site Tools


usersguide:managinguseraccounts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

usersguide:managinguseraccounts [2014/11/12 14:27]
lionelsambuc created
usersguide:managinguseraccounts [2014/11/12 14:27] (current)
lionelsambuc created
Line 1: Line 1:
 +====== Managing User Accounts ======
 +
 +You'll need to be the root user to do any of the following.
 +
 +===== Adding a New Group =====
 +
 +To add a new user group to the system, use the //group add// command.
 +
 +<​code>​
 +# group add wheel
 +</​code>​
 +
 +===== Adding a New User =====
 +
 +To add a new user to the system, run the //user add// command. The arguments to //user add// are //-m// to create a home directory, //-g// followed by the group name, and then the user name. The group must already exist and the user must not.
 +
 +Examples:
 +
 +<​code>​
 +# user add -m -g users foo
 +
 +# user add -m -d /root2 -g operator anotherroot
 +
 +# user add -m -g staff mike
 +
 +# user add -m -g management steve
 +
 +# user add -m -g boss fred
 +</​code>​
 +
 +The typical groups for new users are **other** or **users** (for ordinary users), or **operator** (for system administrator). The user's home directory is normally created in ///home///, but can be changed using the //-d directory// option.
 +
 +The new user's full name and password will be unset and the default shell will be //sh//. To change them, use the //chfn//, //passwd//, //chsh//, and //user mod// commands or have the user set them themselves after logging in.
 +
 +Examples:
 +
 +<​code>​
 +# chfn foo
 +
 +# chsh -s /bin/zsh anotherroot
 +</​code>​
 +
 +The user is now created, but it is still not usable to login, as you must first set a password: ​
 +<​code>​
 +# passwd foo
 +</​code>​
 +
 +==== Operator users ====
 +
 +/!\ **//Stale: information below is not completely accurate, and reflects more the intentions of previous versions of MINIX than the current state.//**
 +
 +The system has been set up with the idea that working as //root// is a bad thing to do. As //root// you are in no way protected from doing stupid things. So do not do development as root, but work as //bin//! Only in exceptional cases do you want to become //root//. Being //root// is fun for wannabe hackers; administrators know better.
 +
 +<div round important>​
 +/!\ **//​Obsolete stuff, which might or might not come back...//**
 +
 +To make life easier for //bin// some programs like su([[http://​www.minix3.org/​manpages/​man1/​su.1.html|1]]),​ install([[http://​www.minix3.org/​manpages/​man1/​install.1.html|1]]) and shutdown([[http://​www.minix3.org/​manpages/​man8/​shutdown.8.html|8]]) treat //bin// and other members of the //​operator//​ group as special and allow them the privileges of //root//. (One is an //​operator//​ if one's group ID is zero.) //​Operator//​s should share the shadow password of root by having ''##​root''​ in their password field. This way they all have one face (password) to the outside world, forming no greater security risk than root alone.
 +</​div>​
 +
 +You can edit the ///​etc/​passwd//​ file using the //vipw// command. By default, it will use the //vi// text editor. This can be changed by using the //EDITOR// environment variable.
 +
 +Example:
 +
 +<​code>​
 +# EDITOR=nano vipw
 +</​code>​
 +
 +==== Default Home Directory Contents ====
 +
 +When you create a new user, the contents of the ///​usr/​ast//​ directory are copied to the user's new home directory. To change the default files provided whenever a new user is created, just change the contents of this directory.
 +
 +===== Removing a User =====
 +
 +To remove a user:
 +
 +<​code>​
 +# user del foo
 +</​code>​
 +
 +To remove a user and their home directory:
 +
 +<​code>​
 +# user del -r foo
 +</​code>​
 +
 +===== Removing a Group =====
 +
 +Removing a group is very similar to removing a user. All you need to do is the following:
 +
 +<​code>​
 +# group del wheel
 +</​code>​
  
usersguide/managinguseraccounts.txt · Last modified: 2014/11/12 14:27 by lionelsambuc