# xdm login



## nedry (Jul 16, 2017)

hi is there a port of the openbsd x login tool like the one in the screen shot below


 ?


----------



## tobik@ (Jul 16, 2017)

Yes, that's just x11/xdm, but FreeBSD uses xdm's default configuration so you will have to do some customizations if you want it to look like on OpenBSD.

Starting with OpenBSD 6.1 they have forked Xdm and rewritten parts of it and called it Xenodm for which there is no port at the moment.


----------



## nedry (Jul 16, 2017)

I just installed XDM and when I try logging in it doesn't start the window manager, I just return to the XDM login screen. Also when I booted into single user mode to edit /etc/ttys file it did not ask for a root password which I thought was not very secure.


----------



## nedry (Jul 16, 2017)

OK, looks like you have to copy .xinitrc to .xsession in your home directory


----------



## SirDice (Jul 19, 2017)

nedry said:


> OK, looks like you have to copy .xinitrc to .xsession in your home directory


Symlink them, that way they'll always be the same, even if you change one.


----------



## SirDice (Jul 19, 2017)

nedry said:


> Also when I booted into single user mode to edit /etc/ttys file it did not ask for a root password which I thought was not very secure.


It's the same on various Linux distributions, Solaris, AIX, HP-UX and quite a few others. Booting to single user mode typically gives you password-less root access. You can turn on authentication though but it's rather useless. Anyone with physical access to the machine will be able to circumvent it.

To have the system ask for root's password in single user mode change "secure" to "insecure" for console in /etc/ttys.


```
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console none                            unknown off secure
```

Note that enabling XDM is typically done through rc.conf:

```
xdm_enable="YES"
```
Starting XDM via /etc/ttys is the "old-school" way and can cause problems.


----------



## nedry (Jul 19, 2017)

when i add 
	
	



```
xdm_enable="YES"
```
 to /etc/rc.conf xdm does not start, i have included the /etc/rc.conf and /etc/ttys. its probably mis-configured xdm in /etc/ttys.

```
#
# $FreeBSD: releng/11.1/etc/etc.amd64/ttys 289634 2015-10-20 16:10:46Z gjb $
#    @(#)ttys    5.1 (Berkeley) 4/17/89
#
# This file specifies various information about terminals on the system.
# It is used by several different programs.  Common entries for the
# various columns include:
#
# name  The name of the terminal device.
#
# getty The program to start running on the terminal.  Typically a
#       getty program, as the name implies.  Other common entries
#       include none, when no getty is needed, and xdm, to start the
#       X Window System.
#
# type The initial terminal type for this port.  For hardwired
#      terminal lines, this will contain the type of terminal used.
#      For virtual consoles, the correct type is typically xterm.
#      Other common values include dialup for incoming modem ports, and
#      unknown when the terminal type cannot be predetermined.
#
# status Must be on or off.  If on, init will run the getty program on
#        the specified port.  If the word "secure" appears, this tty
#        allows root login.
#
# name    getty                type    status        comments
#
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console    none                unknown    off insecure
#
ttyv0    "/usr/libexec/getty Pc"        xterm    on  secure
# Virtual terminals
ttyv1    "/usr/libexec/getty Pc"        xterm    on  secure
ttyv2    "/usr/libexec/getty Pc"        xterm    on  secure
ttyv3    "/usr/libexec/getty Pc"        xterm    on  secure
ttyv4    "/usr/libexec/getty Pc"        xterm    on  secure
ttyv5    "/usr/libexec/getty Pc"        xterm    on  secure
ttyv6    "/usr/libexec/getty Pc"        xterm    on  secure
ttyv7    "/usr/libexec/getty Pc"        xterm    on  secure
ttyv8    "/usr/local/bin/xdm -nodaemon"    xterm    off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
ttyu0    "/usr/libexec/getty 3wire"    vt100    onifconsole secure
ttyu1    "/usr/libexec/getty 3wire"    vt100    onifconsole secure
ttyu2    "/usr/libexec/getty 3wire"    vt100    onifconsole secure
ttyu3    "/usr/libexec/getty 3wire"    vt100    onifconsole secure
# Dumb console
dcons    "/usr/libexec/getty std.9600"    vt100    off secure
```

and the rc.conf file:

```
hostname="bsdboxr2.local"
keymap="uk.iso.kbd"
ifconfig_em0="DHCP"
sshd_enable="YES"
moused_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
hald_enable="YES"
dbus_enable="YES"
rpcbind_enable="YES"
vboxguest_enable="YES"
vboxservice_enable="YES"
xdm_enable="YES"
```


----------



## nedry (Jul 22, 2017)

is this line of code ok for enabling xdm using 
	
	



```
xdm_enable="YES"
```
 in /etc/rc.conf :

```
ttyv8    "/usr/local/bin/xdm -nodaemon"    xterm    off secure
```


----------

