LADOTC

This will teach you how to set up an auth & fs 9front server on one machine to be used in your local network
ACHTUNG! When writing any sort of configuration files, always make sure they end in a new line.

I will start off by assuming that you already have installed 9front with the Cached Worm File System (CWFS) on your machine
I will also not cover how to use regular 9front things such as the shell, rio or a text editor such as sam, acme or ed
You will also need some other computer (ideally also running 9front) to act as a terminal.

first, mount the 9fat partition to have the nvram available automatically:

9fs 9fat

next, edit the plan9.ini under /n/9fat/plan9.ini and add this line
in my case the nvram partition is under my disk (sdN0) /nvram, please make sure and adjust this to your setup

nvram=#S/sdN0/nvram

again, make sure plan9.ini ends in a new line
now save that file (in sam you can type w and then q)
and reboot using fshalt -r or reboot

after rebooting the nvram should be available
you can and need to write to it using the command

wrkey

It might show you some errors that you can ignore
Now it should ask you for the following

authid: <hostowner>
authdom: <your domain>
secstore key: <secstore key>
password: <hostowner password>

the hostowner can be set to glenda and this page will only show you how to set this up using the default user glenda
if for some reason you want to use a different user as the hostowner please refer to the 9front FQA
the authdom can be set to anything if you don't actually intend on running a domain in your local network
please note that you will need this authdom value later
the secstore key can be skipped and is not inherently necessary for this setup, so it can be omitted by just pressing return/enter in the field

now to add another user to the system and configure glenda we first need to make the key fs available by running the command

auth/keyfs

to configure glenda run the following command

auth/changeuser glenda

it should ask for these details

Password: <glendas password>
Confirm password: <glendas password again>
assign new Inferno/POP secret? [y/n]: n
Post id:
User full name:
Department #:
User's email address:
user glenda installed for Plan 9

if you are not in an office environment or similar, most of these can again be skipped by pressing enter
the necessary fields are self explanatory, make sure to enter the same password for glenda here as you have done previously

to add another user the same command can be run

auth/changeuser ladot

Password: <ladots password>
Confirm password: <ladots password again>
assign new Inferno/POP secret? [y/n]: n
Post id:
User full name:
Department #:
User's email address:
user ladot installed for Plan 9

the user glenda has automatically been added to the filesystem at install
but to now actually add the new user to the filesystem you can run the following

echo 'newuser ladot' >> /srv/cwfs.cmd

next, we need to change some network settings to actually turn this machine into the auth and filesystem server
the file needed to edit is under /lib/ndb/local
now the following needs to be added at the bottom of the file, make sure to adjust these settings to your setup

auth=<server hostname> authdom=<your domain>
ipnet=<your domain> ip=192.168.0.0 ipmask=255.255.255.0
ipgw=192.168.0.1
auth=<server local ip>
authdom=<your domain>
fs=<server local ip>
cpu=<server local ip>
dns=192.168.0.1
dnsdomain=<your domain>

sys=<server hostname> ether=<server address> ip=<server ip> ipmask=255.255.255.0 ipgw=192.168.0.1 authdom=<your domain> auth=<server local ip>
dns=192.168.0.2

the server hostname should be set to whatever you typed as the hostname at install
your domain should be set to whatever you set earlier at the authdom prompt
ipgw stands for ip gateway, in my case that is my router
dns is in my case also my router
the last part should partly already be in the file, make sure to adjust it and add the fields added here

next, we need to make some changes to plan9.ini
to again mount it use the command 9fs 9fat
now move to the 9fat

cd /n/9fat/

first, copy the existing plan9.ini twice

cp plan9.ini plan9.ini.orig
cp plan9.ini plan9.ini.new

now edit the current plan9.ini to boot this machine as a cpu server
add the following line

service=cpu

also change the bootargs field to later boot into config mode
in my case, my disk bootargs field looks like this:

bootargs=local!/dev/sdN0/fscache

so I will change it to this:

bootargs=local!/dev/sdN0/fscache -c

in the plan9.ini.new also add the service=cpu line but change the bootargs field to this:

bootargs=local!/dev/sdN0/fscache -a tcp!*!564

and change bootargs to nobootprompt to not make it ask for it every time you boot

nobootprompt=local!/dev/sdN0/fscache -a tcp!*!564

also add these lines

auth=<server local ip>
authdom=<your domain>

now reboot again using fshalt -r or reboot and hit enter at the bootargs prompt
it should now leave you at a prompt like this

config:

type this

config: noauth
auth disabled
config: noauth
auth enabled

it is also recommended to disable the none user, see the FQA on why

config: nonone

now exit the prompt by typing end

config: end

now mount the 9fat partition and move to it again

9fs 9fat
cd /n/9fat/

proceed by copying the current plan9.ini to plan9.ini.cfg and moving the plan9.ini.new to plan9.ini

cp plan9.ini plan9.ini.cfg
mv plan9.ini.new plan9.ini

you can now reboot

you should now be almost done
now, to set up a terminal and finish setting up your user (in my case ladot) follow these next steps

I will again assume that you have already installed 9front regularly on the system that will be your terminal
first, mount the 9fat and move to it again

9fs 9fat
cd /n/9fat/

next, edit plan9.ini and add the following, make sure to again adjust it to your setup

nobootprompt=tls (this may be omitted)
fs=<server local ip>
auth=<server local ip>
essid=<your wifi's ssid> (this may be omitted if you use ethernet or want to enter the ssid every time on boot)
wpapsk=<your wifi's psk> (see above)

if you don't plan on using usb drives much, I also recommend adding the following line

nousbrc=

now reboot and it should ask you for a user, for now type the hostowner of the server, glenda

user[glenda]: glenda

if you have set the essid and wpapsk values it should now automatically connect to your network
next, it should once more ask you for a user, again, enter glenda

user[glenda]: glenda

now it will ask you for a password, enter the password you have set for glenda previously

password: <glenda's password>

depending on your network speed, you might now have to wait a bit
it should now drop you into rio, in a shell do the following
first, start keyfs for good measure

auth/keyfs

make sure factotum is running using ps, if it isn't you can start it using

auth/factotum

now add your user to the factotum, make sure to adjust this to your setup

echo 'key proto=dp9ik dom=<your domain> user=<your user> !password=<your user's password>' >> /mnt/factotum/ctl

after rebooting you should now be able to login as your user

now the final step is to create your user home directory et al.
to do this, run the following command as your user

/sys/lib/newuser