[FreeBSD] Autologin to X. - Printable Version
+- nixers (
+-- Forum: Operating Systems & Administration (
+--- Forum: BSD (
+--- Thread: [FreeBSD] Autologin to X. (/Thread-FreeBSD-Autologin-to-X)

[FreeBSD] Autologin to X. - yrmt - 16-08-2012

Here's how to log in tty first:

- Add an entry to /etc/gettytab:


where *user* is your user name.
*ht* is for real tabs in terminal.
*np* is for no parity in terminal.
*sp* is for speed in baud. 115200 is the highest.
*al* is for auto log in.

- Edit /etc/ttys

ttyv0 "/usr/libexec/getty user" cons25 on secure

where *ttyv0* is the first tty, you can add more to autologin.
*"/usr/libexec/getty user"* tell getty to use the gettytab entry name.
*cons25* is the terminal type. See /etc/termcap.
*on* means it's on.
*secure* means it allows root logins.

- Log in X.

If you use zsh, add to your zshrc:

if [ `/usr/bin/tty` = '/dev/ttyv0' ]; then
startx --:7: 2> /dev/null &

If the terminal is ttyv0 then startx (silent thanks to 2> /dev/null).

- Misc:

optionally, add this to /etc/rc.conf:


optionally, add a .hushlogin file in users's $HOME for a more silent log in:

`touch ~/.hushlogin`