diff --git a/linux-live/basesystem/01-core/rootcopy-install/usr/bin/cmdline_parser b/linux-live/basesystem/01-core/rootcopy-install/usr/bin/cmdline_parser index a3792a0..0ae90f2 100755 --- a/linux-live/basesystem/01-core/rootcopy-install/usr/bin/cmdline_parser +++ b/linux-live/basesystem/01-core/rootcopy-install/usr/bin/cmdline_parser @@ -53,19 +53,20 @@ if [ "$CLOUD" != "true" ]; then echo $USER_NAME:$USER_PASSWORD | chpasswd usermod -a -G sudo $USER_NAME - if [ "$SSH" = "true" ]; then - systemctl enable ssh-keygen - systemctl enable ssh - else - systemctl disable ssh-keygen - systemctl disable ssh - fi sed -i 's,#PermitRootLogin prohibit-password,PermitRootLogin yes,g' /etc/ssh/sshd_config sed -i 's,#PasswordAuthentication yes,PasswordAuthentication yes,g' /etc/ssh/sshd_config else rm -rf /home/live fi +if [ ! "$SSH" = "true" ]; then +# systemctl enable ssh-keygen +# systemctl enable ssh +#else + systemctl disable ssh-keygen + systemctl disable ssh +fi + cat </etc/sudoers.d/90-minios # live user is default user in minios. # It needs passwordless sudo functionality. diff --git a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service index f88caf1..5a1e5cc 100644 --- a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service +++ b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service @@ -1,6 +1,6 @@ [Unit] Description=Command line parsing script -Before=getty.target +Before=ssh-keygen.service [Service] Type=oneshot @@ -9,4 +9,4 @@ RemainAfterExit=true StandardOutput=journal [Install] -WantedBy=getty.target \ No newline at end of file +WantedBy=multi-user.target \ No newline at end of file diff --git a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/getty@.service b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/getty@.service index 3a805ae..49e2871 100644 --- a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/getty@.service +++ b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/getty@.service @@ -11,6 +11,7 @@ Documentation=man:agetty(8) man:systemd-getty-generator(8) Documentation=http://0pointer.de/blog/projects/serial-console.html After=systemd-user-sessions.service plymouth-quit-wait.service After=rc-local.service +After=cmdline-parser.service # If additional gettys are spawned during boot then we should make # sure that this is synchronized before getty.target, even though diff --git a/linux-live/minioslib b/linux-live/minioslib index 9702552..d02ce48 100644 --- a/linux-live/minioslib +++ b/linux-live/minioslib @@ -1519,6 +1519,8 @@ function chroot_configure() { if [ -f /usr/lib/systemd/system/cmdline-parser.service ]; then echo "Enable cmdline-parser.service autostart." >>$OUTPUT 2>&1 systemctl enable cmdline-parser.service >>$OUTPUT 2>&1 + echo "Set up password for user 'root'" >>$OUTPUT 2>&1 + echo root:$ROOT_PASSWORD | chpasswd >>$OUTPUT 2>&1 else if [ $CLOUD != "true" ]; then echo "Set up password for user 'root'" >>$OUTPUT 2>&1 @@ -1682,8 +1684,8 @@ EOF # sed -i 's,#PermitRootLogin prohibit-password,PermitRootLogin yes,g' /etc/ssh/sshd_config # sed -i 's,#PasswordAuthentication yes,PasswordAuthentication yes,g' /etc/ssh/sshd_config #fi - #systemctl enable ssh-keygen >>$OUTPUT 2>&1 - #systemctl enable ssh >>$OUTPUT 2>&1 + systemctl enable ssh-keygen >>$OUTPUT 2>&1 + systemctl enable ssh >>$OUTPUT 2>&1 fi if [ ! -f /usr/share/sudo ]; then