[TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post Reply
ioffo
New here
Posts: 2
Joined: Thu Jan 12, 2017 6:24 pm

[TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by ioffo »

Hello!

I own a TS-253A and have problems with an Ubuntu LXC container I created. After updating a ver firmware versions and rebooting the NAS a few times, the container started asking me for a login/password. I want to regain root access to my server!

I performed these steps when setting up my container:

1) Accessed container creation page in Containerstation
Image

2) Selected Ubunutu LXC container
Image

3) Set up options, custom hostname, advanced option and NAT (not shown in this image). Please note: There was NO OPTION to select usernames and passwords
Image

4) Start container -> root access via console window works. I copied over files, worked with the server (I set up a custom minecraft server). Stopped and started the server and always had root access via the console window in container station.

5) Made some NAS firmware updates and rebooted a few times.

6) Start container -> the console window asks for a login/password (which I don't have set up!). No root access possible.
Image

Please help me get access to my server!!
aidy12
Starting out
Posts: 12
Joined: Sun Oct 05, 2008 7:15 pm

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by aidy12 »

I just ran into this problem.

Apparently running "apt upgrade" in the container installs something that breaks the auto-login..

I created a new container and it works fine.

Bit annoying not being able to do an "apt upgrade" with fear of breaking it though..
ioffo
New here
Posts: 2
Joined: Thu Jan 12, 2017 6:24 pm

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by ioffo »

Hello!

Luckily support was able to fix my container via remote support, saving me hours of trying to reinstall the lxc container and all my files on it. They also sent me a .PDF file with the solution for future reference, but I can not attach it to this post (invalid file type?). So here follows the complete text from the PDF. Maybe it will help someone with the same problem:

Code: Select all

KB - How to configure LXC image autologin

Reference: http://qnap.dorowu.com/gitlab/snippets/46

Code: Select all

Ubuntu 16.04

Edit /lib/systemd/system/container-getty\@.service and add -a root:

# vim /lib/systemd/system/container-getty\@.service

[Service]

ExecStart=-/sbin/agetty -a root --noclear --keep-baud pts/%I 115200,38400,9600 $TERM

Edit /lib/systemd/system/console-getty.service and add -a root:

# vim /lib/systemd/system/console-getty.service

[Service]

ExecStart=-/sbin/agetty -a root --noclear --keep-baud console 115200,38400,9600

$TERM

Code: Select all

Debian 8.5

Edit /lib/systemd/system/container-getty\@.service and add -a root:

# vim /lib/systemd/system/container-getty\@.service

[Service]

ExecStart=-/sbin/agetty -a --noclear --keep-baud pts/%I 115200,38400,9600 $TERM

Edit /lib/systemd/system/console-getty.service and add -a root:

# vim /lib/systemd/system/console-getty.service

[Service]

ExecStart=-/sbin/agetty -a root --noclear --keep-baud console 115200,38400,9600

$TERM

Edit /etc/systemd/system/getty\@.service and add -a root:

# vim /etc/systemd/system/getty\@.service

[Service]

ExecStart=-/sbin/agetty -a root --noclear %I $TERM

Code: Select all

Fedora 24

Edit /lib/systemd/system/container-getty\@.service and add -a root:

# vim /lib/systemd/system/container-getty\@.service

[Service]

ExecStart=-/sbin/agetty -a root --noclear --keep-baud pts/%I 115200,38400,9600 $TERM

Edit /lib/systemd/system/console-getty.service and add -a root:

# vim /lib/systemd/system/console-getty.service

[Service]

ExecStart=-/sbin/agetty -a root --noclear --keep-baud console 115200,38400,9600

$TERM

Edit /etc/systemd/system/getty\@.service and comment out ExecStart line:

# vim /etc/systemd/system/getty\@.service

[Service]

# ExecStart=-/sbin/agetty --noclear %I $TERM
User avatar
NAS-26
Starting out
Posts: 36
Joined: Thu Jul 16, 2015 8:51 pm

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by NAS-26 »

I have the same problem now. But without the possibility to login (don't know the root password) I can't execute any vi or something else. What is the default root password?
----------------
Model: TS-453 Pro, RAID 5
aidy12
Starting out
Posts: 12
Joined: Sun Oct 05, 2008 7:15 pm

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by aidy12 »

NAS-26 wrote:I have the same problem now. But without the possibility to login (don't know the root password) I can't execute any vi or something else. What is the default root password?
You can SSH into your NAS and edit the files from there.
You should find the root directory of your containers at the approximately the following location (depending on your setup):

/share/CACHEDEV1_DATA/Container/container-station-data/lib/lxc/nameofyourcontainer/rootfs

So in my case I can:

Code: Select all

vi /share/CACHEDEV1_DATA/Container/container-station-data/lib/lxc/blog/rootfs/lib/systemd/system/container-getty\@.service

vi /share/CACHEDEV1_DATA/Container/container-station-data/lib/lxc/blog/rootfs/lib/systemd/system/console-getty.service
mseewald
Starting out
Posts: 29
Joined: Sat Nov 11, 2017 9:38 pm

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by mseewald »

I can confirm that this problem exists also with Debian Buster (http://download.qnap.com/QPKG/container ... d64.tar.gz). Above solution still works.
dosborne
Experience counts
Posts: 1811
Joined: Tue May 29, 2018 3:02 am
Location: Ottawa, Ontario, Canada

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by dosborne »

mseewald wrote: Mon Sep 09, 2019 12:13 am I can confirm that this problem exists also with Debian Buster (http://download.qnap.com/QPKG/container ... d64.tar.gz). Above solution still works.
After making the 2 changes above, with the Debian Buster container, and restarting Container Station and the container itself, I still am unable to login:
Debian GNU/Linux 10 Ubuntu1 pts/0
Ubuntu1 login: root (automatic login)
Login incorrect
Ubuntu1 login:
Any other ideas?
QNAP TS-563-16G 5x10TB Seagate Ironwolf HDD Raid-5 NIC: 2x1GB 1x10GbE
QNAP TS-231P-US 2x18TB Seagate Exos HDD Raid-1
[Deadbolt and General Ransomware Detection, Prevention, Recovery & MORE]
toxiroxi
Starting out
Posts: 42
Joined: Sat Sep 13, 2014 11:07 pm

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by toxiroxi »

unfortunately i am having the same problem and still could not resolve that.

i've compared with another working buster lxc container running on my nas but i cannot remember anymore how i fixed that :-(

when i am entering the same config from the working container to the non working container it is still not working .....there must be something different which is not working.
any further more ideas?
that's how my lines look like at the moment:

ExecStart=-/sbin/agetty -o '-p -- \\u' root --noclear --keep-baud console 115200,38400,9600 $TERM

Thanks a lot,
decompiled
New here
Posts: 2
Joined: Mon Aug 24, 2015 12:06 am

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by decompiled »

I am also having this issue. Install a fresh debian buster lxc container. Authentication in container-station happens correctly until the QNAP gets a firmware upgrade. Post upgrade the container can not be authenticated to.
Peter.Parker
New here
Posts: 6
Joined: Wed Jul 22, 2020 1:23 am

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by Peter.Parker »

decompiled wrote: Tue May 19, 2020 1:20 am I am also having this issue. Install a fresh debian buster lxc container. Authentication in container-station happens correctly until the QNAP gets a firmware upgrade. Post upgrade the container can not be authenticated to.
Ditto.
phreichmuth
Know my way around
Posts: 237
Joined: Fri Jan 09, 2009 12:17 am

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by phreichmuth »

mseewald wrote: Mon Sep 09, 2019 12:13 am I can confirm that this problem exists also with Debian Buster (http://download.qnap.com/QPKG/container ... d64.tar.gz). Above solution still works.
mseewald, I installed debian buster with the container you linked here and tried the guide above. But I have the problem that the third file to change /etc/systemd/system/getty@.service does not even exist.

Could you please verify the required changes and which files you really modified? Would be a great help.
TS-253D, QTS 5.0
TS-128A, QTS 5.0
phreichmuth
Know my way around
Posts: 237
Joined: Fri Jan 09, 2009 12:17 am

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by phreichmuth »

Ok, I fugured it out how it shall look ilke in debican buster 10:

Code: Select all

Edit /lib/systemd/system/container-getty\@.service and add -a in section  [Service]:
ExecStart=-/sbin/agetty -a --noclear --keep-baud pts/%I 115200,38400,9600 $TERM

Edit /lib/systemd/system/console-getty.service and add -a root in section  [Service]:
ExecStart=-/sbin/agetty -a root --noclear --keep-baud console 115200,38400,9600 $TERM

Edit /etc/systemd/system/getty\@.service and add -a root in section  [Service]:
ExecStart=-/sbin/agetty -a root --noclear %I $TERM

Edit /lib/systemd/system/serial-getty\@.service and add -a root in section [Service]:
ExecStart=-/sbin/agetty -a root --keep-baud 115200,38400,9600 %I $TERM
This is how the lines shall look like.
Beside, the option "Unix authentication" must be activated in the GUI of

Code: Select all

pam-auth-update
Now, everything seems to work, even after restarting the container as well as the container station. I assume also after restarting the NAS. Firmware update I could not check yet due to no available update currently.
TS-253D, QTS 5.0
TS-128A, QTS 5.0
mseewald
Starting out
Posts: 29
Joined: Sat Nov 11, 2017 9:38 pm

Re: [TS-253A] Ubuntu-xenial LXC container started asking for login/password

Post by mseewald »

phreichmuth wrote: Mon Apr 05, 2021 4:38 am Could you please verify the required changes and which files you really modified? Would be a great help.
I see from the other post that it's now working for you.

Just in case anyone reading this is logged out again. You should be able to log in by going to the NAS console (SSH access), then using "lxc-console --name <CONTAINERNAME>".
Post Reply

Return to “Container Station”