You are not logged in.

#1 2020-05-16 05:39:00

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

Can't login to systemd-nspawn (securetty deleted) [Solved]

I'm assuming there's a simple solution I've overlooked to this.

I created a new nspawn container, as per the wiki, but I get "Login incorrect" when I try to login as root.

% sudo mkdir /var/lib/machines/mymachine
% sudo pacstrap -c /var/lib/machines/mymachine base
% sudo rm /var/lib/machines/mymachine/etc/securetty /var/lib/machines/mymachine/usr/share/factory/etc/securetty
% sudo systemd-nspawn -b -D /var/lib/machines/mymachine

After it's done starting, I get:

Arch Linux 5.6.13-arch1-1 (console)

mymachine login: root
Password:
Login incorrect

Note: I just hit enter as the default root password, as I understand it, is blank. I'd add the pts to the file, but as you can see it says I'm coming from console. I have tried with

machinectl start mymachine

and then

machinectl login mymachine

and that also fails but says I'm using pts/1. Adding both pts1 and pts/1 to a new /var/lib/machins/mymachine/etc/securetty file didn't change anything either; I still get "login failed" both times.

The wiki mentions journal entries (I assume on the host) regarding PAM but I don't get any at all. I ran journalctl -f in another terminal then tried to restart and login to the container, but the only entries I get are:

May 16 01:36:19 lochagos systemd-machined[27090]: New machine mymachine.
May 16 01:36:19 lochagos systemd[1]: Started Container mymachine.

I did try to use the -M flag on journalctl to connect to the nspawn, but I get a "Failed to open root directory: No machine '/var/lib/machines/mymachine' known" error. The machine was running at the time I tried (although not logged into, obviously).

Last edited by dtjohnst (2020-05-16 06:04:12)

Offline

#2 2020-05-16 05:48:36

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Can't login to systemd-nspawn (securetty deleted) [Solved]

dtjohnst wrote:

Note: I just hit enter as the default root password, as I understand it, is blank.

Says who?

https://git.archlinux.org/svntogit/pack … ab1705185b

Offline

#3 2020-05-16 05:55:06

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

Re: Can't login to systemd-nspawn (securetty deleted) [Solved]

The wiki.

After the container starts, log in as "root" with no password.

I'll try editing the shadow file and try again.

EDIT: Removing the * from the root entry in the shadow file resolves the problem.

Last edited by dtjohnst (2020-05-16 06:04:01)

Offline

Board footer

Powered by FluxBB