scp-ing a shellshock-patched
bash binary to an openSUSE 12.2 Linux VM and replacing the login shell with it, no user can log in via
ssh or the console. As it turned out, the executable bit got lost during transfer, despite using the
I tried to repair this by mounting the filesystem on the Linux Xen host and doing
chmod +x /mnt/usr/local/bin/bash, but the situation did not improve. Will rebooting the guest VM help?
This is what I see on console:
xxx login: root Password: Last login: xxx Have a lot of fun... -- root: no shell: permission denied
This appears in
on ssh login:
sshd: User root not allowed because shell /bin/bash is not executable sshd: input_userauth_request: invalid user root [preauth] sshd: Postponed keyboard-interactive for invalid user root from x.x.x.x port xxxxx ssh2 [preauth]
on console login:
systemd-logind: New session x of user root. login: ROOT LOGIN ON xvc0 console-kit-daemon: WARNING: Unable to spawn /etc/ConsoleKit/run-session.d/dbus_at_console.ck: Failed to execute child process "/etc/ConsoleKit/run-session.d/dbus_at_console.ck" (Permission denied) systemd-logind: Removed session x.
And this is how I caused the problem:
# my /bin/bash has been a symlink to /usr/local/bin/bash since the first shellshock patch scp -p buildhost:/tmp/bash /tmp/bash # then I forgot to do chmod +x /tmp/bash # then I forgot to do chsh -s /usr/bin/zsh, logout and login mv /tmp/bash /usr/local/bin/bash && \ mv /bin/bash /var/tmp/bash-unpatched && \ chmod -x /var/tmp/bash-unpatched && \ ln -s /usr/local/bin/bash /bin/bash
/bin/bash symlink by a real binary did not help either.