This describes how to add a new user to several types of Plan 9 installations:
NOTE: after creating the new user you must log in as the new user and run:
/sys/lib/newuser
see newuser(8) for details.
Here's a small script that installs a new user on a Plan 9 fossil file server, call it 'adduser'. It will give you the commands to add the new user, which you can send back to an rc session as the host owner (or the user who can write to the fossil console):
#!/bin/rc switch( $#*) { case 1 newuser=$1 case * { echo 'usage: '^$0^' username' exit usage } } echo 'echo uname '^$newuser $newuser^' >> /srv/fscons' echo 'echo fsys main >> /srv/fscons' echo 'echo create /active/mail/box/'^$newuser $newuser^' upas d775 >> /srv/fscons' echo 'echo create /active/cron/'^$newuser $newuser $newuser^' d775 >> /srv/fscons'
disk/kfscmd 'newuser tor'
it will automatically perform the following tasks
282:tor:tor:
to /adm/users
disk/kfscmd 'create /usr/tor tor tor 775 d'
The following two commands have to be executed manually
disk/kfscmd 'create /mail/box/tor tor upas 775 d' disk/kfscmd 'create /mail/box/tor/mbox tor upas 622 al'
creating tor's home directory and mail box. Now you'll want to halt the disks and reboot to log in as tor; the first thing to do then is to set up a profile and start the window system by running (as described at the top of this page):
/sys/lib/newuser
/sys/lib/newuser
Last modified Thu Mar 31 18:16:24 EST 2005 |