Default FreeBSD installation will boot into command line login prompt, requiring users to log into the system before gaining access to the programs, which is usually done by typing username and password interactively. In some cases, however, we want to login certain user automatically on boot. Steps to accomplish this task are described in the following article.

Provided that user pacija already exists, we will use gettytab to instruct system not to ask it for password:

echo "# autologin" >> /etc/gettytab 
echo "pacija:\" >> /etc/gettytab 
echo "        :ht:np:sp#115200:al=pacija:" >> /etc/gettytab

As we prefer to keep system console ttyv0 reserved for syslog notifications, we will replace line referencing first virtual terminal in ttys:

sed -i '' '/ttyv1/s/Pc/pacija/g' /etc/ttys

Once we reboot, pacija will be automatically logged into system on first virtual terminal, to which one can switch by pressing Alt+F1.

Next Post