# Starting "screen" session on main console (/dev/tty0) at boot?



## Spartrekus (May 13, 2018)

Hello

I would like to boot FreeBSD and that it does directly start and display a running screen session.

So that, herewith, I will connect via SSH and can "pilot" the given screen session (over SSH). It is then a sort of multihead (for low resource) display.

my command at boot would be (for root or regular user, doesnt matter much to me):  
   screen -d -m -S myscreensession

I am looking forward to reading your ideas or tipps.

Thank you a lot in advance.


----------



## zirias@ (May 13, 2018)

Well, you can change the line for `ttyv0` in /etc/ttys to perform an auto logon for root:

```
ttyv0   "/usr/libexec/getty al.Pc"         xterm   on  secure
```
If you want a different user, add an entry similar to `al.Pc` in /etc/gettytab, for example

```
aljohn.Pc:\
        :al=johndoe:tc=Pc
```
and use this in /etc/ttys.

Then, you can use your shell's startup files to launch screen *if* you're on `ttyv0`, just use the output of tty(1) for checking.

BTW, any specific reason to prefer screen over sysutils/tmux?


----------

