nixers
[FreeBSD] Autologin to X. - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Operating Systems (https://nixers.net/forumdisplay.php?fid=4)
+--- Forum: BSD (https://nixers.net/forumdisplay.php?fid=13)
+--- Thread: [FreeBSD] Autologin to X. (/showthread.php?tid=125)


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

Here's how to log in tty first:

- Add an entry to /etc/gettytab:

``
user:\
:ht:np:sp#115200:al=user:
``

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 &
fi


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

- Misc:

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

``
blanktime="NO"
``

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

`touch ~/.hushlogin`