crims0n 4 years ago
parent
commit
e56a8211f7
  1. 15
      linux-live/basesystem/01-core/rootcopy-install/usr/bin/cmdline_parser
  2. 4
      linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service
  3. 1
      linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/getty@.service
  4. 6
      linux-live/minioslib

15
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 <<EOF >/etc/sudoers.d/90-minios
# live user is default user in minios.
# It needs passwordless sudo functionality.

4
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
WantedBy=multi-user.target

1
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

6
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

Loading…
Cancel
Save