Getting Started With Plan 9
Getting Started With Plan 9
ABSTRACT
Documentation
Plan 9 has two graphical text editors: acme and sam. Sam is a
fairly traditional multi-file editor based upon structural regular
expressions, while acme takes a more radical approach to
almost everything and is a little better integrated with some
aspects of the system, namely the window system and
plumbing. A full introduction to either is beyond the scope of
this document, but the papers in Volume 2 of the manual
contain good introductions. The manual
pages acme(1) and sam(1) are also helpful here.
Input
To add a new user, add the user to the /adm/users file and then
run the user command; the format of the file is documented
in users(6). (Note that on a standalone file server,
the newuser command manages users, to avoid turning off
permission checking.) The fs(8) and kfscmd(8) manual pages
explain more file system commands.
282:tor:tor:
to /adm/users, run kfscmd user, and then run
Network Databases
database=
file=/lib/ndb/local
file=/lib/ndb/common
You can add as many files as you like, but due to a limitation
in libndb, you need to restart all network services after
changing the set of files. In practice, the easiest way to do this
is usually to reboot the system. (You can, of course, make
changes to individual files without rebooting; it is only
necessary when you add or remove a file from
the database= list). By convention, common holds information
that is not site-specific, like TCP assigned port
numbers. Local and the other files hold site-specific
configuration.
sys=lusitania
ip=10.0.20.30
ether=00a02124062f
dom=lusitania.cs.moscvax.edu
or anything like it; items on the same line are bound more
tightly than those on separate lines, but most programs ignore
this information. The indentation is significant: a line with no
initial whitespace begins a new entry.
ip=10.0.1.2 sys=dns-server
ip=10.0.1.3 sys=ntp-server
ip=10.0.0.2 sys=math-ntp-server
ip=10.0.20.2 sys=cs-dns-server
ip=10.0.20.3 sys=cpu-server proto=il
ip=10.0.20.4 sys=file-server proto=il
IP Configuration
Network Daemons
Reading mail
If you are going to run an SMTP server, you should edit the
files /mail/lib/smtpd.conf and /mail/lib/blocked to configure it.
Sending mail
The last rule in the rewrite files calls /mail/lib/qmail, which both
queues the message and starts a daemon to try to deliver the
messages currently in the queue (see qer(8) for more details).
On systems not always connected to the internet, you may
wish to use /mail/lib/justqmail instead, which only queues the
message, and does not start a delivery daemon. When you are
connected to the internet or your mail gateway, you can
run /mail/lib/kickqueue to have the daemon try to send mail.
SSH
To use the Plan 9 SSH tools, you must generate a host key for
your system. To do this, run aux/ssh_genkey while permission
checking is off; this will create the
files /sys/lib/ssh/hostkey.public and /sys/lib/ssh/hostkey.secret;
be sure that hostkey.secret is not readable by any user but the
one used to run network listeners.
cd $home/lib
aux/ssh_genkey -d $user
cat $user.secret >> userkeyring
chmod 400 userkeyring
The file $user.public10 created in your personal lib directory is
suitable for sharing with Unix machines, e.g., for putting in
your authorized_keys file on a Unix machine.
Printing
The Plan 9 print spooler lp does not take the same arguments
as the BSD lpr, nor as the lp that ships with some Unixes. It is
worth reading the manual page to get up to speed on useful
options. The file /sys/lib/lp/devices contains example devices
for printing to printers on parallel ports or BSD lpr-based
queues.
TeX
Decide what name to give your cpu server owner. This is the
user that all the cpu servers run as. We'll name the
user bootes. Choose a password for bootes. (Just keep it in your
head for now.) Edit /adm/users as described above to create
any users you want the kfs file server to know about.
aux/ssh_genkey
chgrp -u bootes /sys/lib/ssh/hostkey.*
cd /rc/bin/service.auth
mv authsrv.il566 il566
mv authsrv.tcp567 tcp567
cd /sys/src/9/pc
mk 'CONF=pccpudisk' 9pccpudisk
9fat:
cp 9pccpudisk /n/9fat/9pccpud
Note that you can't call it 9pccpudisk because the bootstrap
loader does not know about long FAT filenames.
Edit /n/9fat/plan9.ini to say bootfile=sdXX!9fat!9pccpud,
where sdXX is the disk with the 9fat partition.
Once rio comes up, create some user accounts in the key
database by using auth/changeuser (see auth(8)). In particular,
be sure to create an account for bootes using the same
password you just typed.
At this point you should be all set. Test out a new user account
by attempting to telnet into the auth server as that user,
using netkey to respond to the challenge.