LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Error creating lxc container on -current (https://www.linuxquestions.org/questions/slackware-14/error-creating-lxc-container-on-current-4175677752/)

montagdude 06-27-2020 08:45 PM

Error creating lxc container on -current
 
I get this error when trying to create a Slackware64-current container:

Code:

chpasswd: error while loading shared libraries: libpam.so.0: cannot open shared object file: No such file or directory
Error creating container Slackware64-current

Adding pam to the minimal list of packages in /usr/share/lxc/templates/lxc-slackware fixes that problem. However, now I get this error:

Code:

chpasswd: (user root) pam_chauthtok() failed, error:
Module is unknown
chpasswd: (line 1, user root) password not changed
Error creating container Slackware64-current

As a guess, I tried adding krb5 and pam-krb5 (separately) to the list, but that didn't help. Anyone know which packages are needed for chpasswd to work correctly?

willysr 06-27-2020 09:33 PM

You need to add libpwquality

montagdude 06-28-2020 06:08 AM

I still get the same error with libpwquality.

willysr 06-28-2020 04:17 PM

Did you add cracklib too?

montagdude 06-29-2020 07:36 AM

Making progress. After adding libpwquality and cracklib I get this:

Code:

chpasswd: (user root) pam_chauthtok() failed, error:
Authentication token manipulation error
chpasswd: (line 1, user root) password not changed
Error creating container Slackware64-current


petejc 06-29-2020 07:44 AM

Quote:

Originally Posted by montagdude (Post 6139251)
Making progress. After adding libpwquality and cracklib I get this:

Code:

chpasswd: (user root) pam_chauthtok() failed, error:
Authentication token manipulation error
chpasswd: (line 1, user root) password not changed
Error creating container Slackware64-current


I'm having similar issues. I installed cracklib and libpwquality as suggested however, I'm not getting as far the error you have, I'm still getling the libpam error:

Code:

lxc-create -n test -t slackware --bdev dir

....

Configuring...

Adding an etc/fstab that must be modified later with the
full path of the container's rootfs if you decide to move it.
chpasswd: error while loading shared libraries: libpam.so.0: cannot open shared object file: No such file or directory
Error creating container test

I also note that --bdev btrfs seems not to work either, with different errors. No idea if that is related.

willysr 06-29-2020 08:06 AM

According to https://www.codevoila.com/post/26/fi...word-in-ubuntu, it's related to permission of /etc/shadow

montagdude 06-29-2020 08:30 AM

Quote:

Originally Posted by petejc (Post 6139253)
I'm having similar issues. I installed cracklib and libpwquality as suggested however, I'm not getting as far the error you have, I'm still getling the libpam error:

Code:

lxc-create -n test -t slackware --bdev dir

....

Configuring...

Adding an etc/fstab that must be modified later with the
full path of the container's rootfs if you decide to move it.
chpasswd: error while loading shared libraries: libpam.so.0: cannot open shared object file: No such file or directory
Error creating container test

I also note that --bdev btrfs seems not to work either, with different errors. No idea if that is related.

That was the error I got before adding pam. Did you do that?

petejc 06-29-2020 09:31 AM

Quote:

Originally Posted by montagdude (Post 6139267)
That was the error I got before adding pam. Did you do that?

OK. Should have read the first post more carefully. I installed cracklib and libpwquality on the host system (but I assume they should already have been there) and I missed the bit about pam.

So I updated the template to add pam, cracklib and libpwquality, and I get the same, I thnk, as the other poster.

Code:

Configuring...

Adding an etc/fstab that must be modified later with the
full path of the container's rootfs if you decide to move it.
chpasswd: (user root) pam_chauthtok() failed, error:
Authentication token manipulation error
chpasswd: (line 1, user root) password not changed
Error creating container test


willysr 06-29-2020 11:17 AM

Have you checked the /etc/shadow permission?

montagdude 06-29-2020 11:29 AM

Quote:

Originally Posted by willysr (Post 6139323)
Have you checked the /etc/shadow permission?

I tried adding chmod 640 $rootfs/etc/shadow in the slackware lxc template, but it didn't help.

petejc 06-29-2020 01:05 PM

Quote:

Originally Posted by montagdude (Post 6139329)
I tried adding chmod 640 $rootfs/etc/shadow in the slackware lxc template, but it didn't help.

My setup already has these same permissions:

Code:

root@phoenix:/var/cache/lxc/slackware/rootfs-current-x86_64/etc# ls -al shadow
-rw-r----- 1 root shadow 704 May 15 04:07 shadow

Does not move us forward except that two people are having the same issue on different systems.

montagdude 06-29-2020 02:16 PM

Well, I've got a workaround. With the following changes to /usr/share/lxc/templates/lxc-slackware, I can get a working container. Basically, I add the a, ap, d, k, l, and n groups to the installer. It's no longer minimal, though, but that's okay for me because I wanted a full install anyway. But I think this confirms that the problem is missing packages in addition to the ones that have already been identified (rather than a configuration issue like permissions), but I don't know which ones.

Code:

--- lxc-slackware        2020-01-02 15:21:06.000000000 -0500
+++ lxc-slackware.new        2020-06-29 15:08:09.821555944 -0400
@@ -95,8 +95,8 @@
 for clear_device in ${DEV}/null ${DEV}/zero ${DEV}/random ${DEV}/urandom \
  ${DEV}/tty ${DEV}/console ${DEV}/tty0 ${DEV}/tty1 ${DEV}/tty2 ${DEV}/tty3 \
  ${DEV}/tty4 ${DEV}/tty5 ${DEV}/full ${DEV}/initctl ${DEV}/loop0 \
-  ${DEV}/loop1 ; do
-  rm -f $clear_device

+  ${DEV}/loop1 ${DEV}/pts ${DEV}/shm ${DEV}/ptmx ${DEV}/fd; do
+  rm -rf $clear_device

 done
 # Create initial set of devices:
 mknod -m 666 ${DEV}/null c 1 3
@@ -237,6 +237,7 @@
 bin
 bzip2
 coreutils
+cracklib
 cyrus-sasl
 db48
 dcron
@@ -261,6 +262,7 @@
 libcap-ng
 libffi
 libmnl
+libpwquality
 libtasn1
 libunistring
 logrotate
@@ -272,6 +274,7 @@
 openssh
 openssl-solibs
 p11-kit
+pam
 pkgtools
 procps-ng
 sed
@@ -304,6 +307,7 @@
 
 slackpkg -default_answer=n update
 slackpkg install-template $TEMPLATE
+slackpkg install a ap d k l n
 
 # add a slackpkg default mirror
 echo "$MIRROR/$PKGMAIN-$release/" >> $ROOT/etc/slackpkg/mirrors


ponce 06-29-2020 02:27 PM

I just tested it and I spotted an issue with pam_securetty (as we seem to login from pts/0 using lxc-console): you can check if this is solves your issue editing /etc/securetty in the container (allowing login from pts)
Code:

sed -i "s|^#pts|pts|" $ROOT/etc/securetty
you should also have related errors in /var/log/secure if this is the case...

regarding the packages template for the container this is the new one I used here
Code:

aaa_base
aaa_elflibs
aaa_terminfo
bash
bin
bzip2
cracklib
coreutils
cyrus-sasl
db48
dcron
dhcpcd
dialog
diffutils
e2fsprogs
elfutils
elvis
etc
eudev
findutils
gawk
glibc-solibs
gnupg
gnutls
grep
gzip
iproute2
iputils
kmod
libcap-ng
libffi
libmnl
libpsl
libpwquality
libtasn1
libtirpc
libunistring
logrotate
mpfr
net-tools
nettle
network-scripts
ncurses
openssh
openssl-solibs
pam
pcre2
p11-kit
pkgtools
procps-ng
sed
shadow
sharutils
slackpkg
sysklogd
sysvinit
sysvinit-functions
sysvinit-scripts
tar
util-linux
wget
which
xz

it can be in your case that just libtirpc is needed.

BTW, here you can find a new version of the build script with the new template and the new init scripts (synced with the ones from Slackware current as today)

http://ponce.cc/slackware/testing/lxc/

montagdude 06-29-2020 03:14 PM

Quote:

Originally Posted by ponce (Post 6139392)
I just tested it and I spotted an issue with pam_securetty (as we seem to login from pts/0): you can check if this is solves your issue editing /etc/securetty in the container (allowing login from pts)
Code:

sed -i "s|^#pts|pts|" $ROOT/etc/securetty
you should also have related errors in /var/log/secure if this is the case...

regarding the packages template for the container this is the new one I used here
<snip>
it can be in your case that just libtirpc is needed.

BTW, here you can find a new version of the build script with the new template and the new init scripts (synced with the ones from Slackware current as today)

http://ponce.cc/slackware/testing/lxc/

That worked. I didn't need to make any changes to pam_securetty in order to get it installed and apparently working. So to summarize, the following 4 packages need to be added to the list:
  • cracklib
  • libpwquality
  • libtirpc
  • pam


All times are GMT -5. The time now is 01:39 PM.