OpenBSDLab - otx config

This site describes the configuration steps of a new OpenBSD test machine.

adduser(8)

$ doas adduser
Use option ``-silent'' if you don't want to see all warnings and questions.

Reading /etc/shells
Check /etc/master.passwd
Check /etc/group

Ok, let's go.
Don't worry about mistakes. There will be a chance later to correct any input.
Enter username []: otx
Enter full name []: OpenBSD Test x
Enter shell csh ksh nologin sh [ksh]: 
Uid [1024]: 
Login group otx [otx]: 
Login group is ``otx'. Invite otx into other groups: guest no 
[no]: test
Login class authpf bgpd daemon default pbuild staff unbound 
[default]: 
Enter password []: 
Disable password logins for the user? (y/n) [n]: y

Name:        otx
Password:    ****
Fullname:    OpenBSD Test x
Uid:         1024
Gid:         1024 (otx)
Groups:      otx test
Login Class: default
HOME:        /home/otx
Shell:       /bin/ksh
OK? (y/n) [y]: 
Added user ``otx''
Copy files from /etc/skel to /home/otx
Add another user? (y/n) [y]: n
Goodbye!

ssh-key

doas -su otx
ssh-keygen
...

users

doas cp /home/test/users /home/otx
doas /home/test/bin/keyrollout.sh

/etc/hosts

...
10.0.1.x       otx

/etc/conserver.cf

...
console otx {
	include cyclades;
	device /dev/cuacX;
	rw otx;
}
...

environment

The following files contain the environment variables, which are used to control the different ssh commands of the machine.

File Description
/home/otx/env/hwaddr MAC address of the PXE booting NIC
/home/otx/env/ipaddr IP address of the PXE booting NIC
/home/otx/env/arch Architecture of the machine
/home/otx/env/install Existence of this file allows automatic installation of the machine
/home/otx/env/machine name of the machine
/home/otx/env/rootpw Password of the root user used by the automatic installation
/home/otx/env/userpw Password of the user used by the automatic installation
/home/otx/env/setserver Address of the server to search for install sets during automatic installations and upgrades
/home/otx/env/siteserver Address of the server to search for siteXX.tgz during automatic installations and upgrades
/home/otx/env/powerdevice Name of the remote power switch device for this machine
/home/otx/env/powerport Number of the power socket of the machine
/home/otx/env/sshkey sshkey which is installed on the machine during automatic installation
/home/otx/env/tftpserver Address of the tFTPserver used for automatic installations and upgrades

/etc/ssh/sshd_config

...
Match User otx
	ForceCommand /home/test/bin/run.sh
	X11Forwarding no
	AllowAgentForwarding no
	PermitOpen 10.0.1.xx:22
...

/var/spool/tftp

$ cd /var/spool/tftp
$ doas mkdir otx
$ doas chown otx:otx otx
$ doas ln -s otx 10.0.1.x

/etc/dhcpd.conf

Insert the following entry in just one line.
...
host otx {
	hardware ethernet xx:xx:xx:xx:xx:xx;
	fixed-address 10.0.1.x;
	next-server 10.0.1.1;
	filename "invalid";
} #otx
...