autologin on default shell /bin/sh

Warren Block wblock at
Mon Sep 26 15:53:58 UTC 2011

On Mon, 26 Sep 2011, Antonio Olivares wrote:

> If I type my username and login, startx starts automatically, but 
> after I have logged in by typing my username and password.

That means the part that starts X is correct.

> This is an excerpt of /etc/ttys on FreeBSD 9.0 BETA 2
> ttyv0   "/usr/libexec/getty Pc"         xterm   on  secure
> # Virtual terminals
> ttyv1   "/usr/libexec/getty Pc"         xterm   on  secure

Don't use xterm, it won't be able to run before X has started.

"Pc" is the standard login.  The new entry in /etc/gettytab creates a 
new "Al" for autologin:

A|Al|Autologin console:\

The "A", "Al", and "Autologin console" are all names for that entry.

When the system starts, it will start the ttys listed in /etc/ttys:

ttyv0	"/usr/libexec/getty Pc"		cons25	on  secure
ttyv1	"/usr/libexec/getty Al"		cons25	on  secure

I leave ttyv0 alone for log messages and such, and put the autologin on 

An autologin system probably won't need the rest of the ttyv entries and 
they can be commented out.

More information about the freebsd-questions mailing list