locked out by faulty sshd config -- an idea
Posted: 09 Dec 2009, 13:08
As a fresh new member, I first would like to present my best regards to all.
Second: here is my problem and one idea to solve it that I kindly submit to bubba-linux-experts.
- My first (inferred) mistake was to put a comma in the "allowed users" list in /etc/ssh/sshd_config.
- My second mistake was that, although I have automatic backup on a nice "bubba-storage" unit, I forgot to save system files(!)
- Consequence: no user is allowed anymore to open a session on bubba2 via sshd. The situation is the same as closing one's home door leaving the keys inside! To make it worse, I am really afraid of loose my unsaved (heavy) system configurations!
After reading old posts on this forum and inspecting the contents of the "bubba.img" on the bubba2 stick installer, I wonder whether the following has a chance to work without destroying my system:
1) loop-mount on /mnt the "bubba.img" read from the usb-stick
2) replace /mnt/bin/bubbainstall.sh with the following:
#!/bin/sh
mount -t ext3 /dev/hda1 /mnt
cd /mnt/etc/ssh
mv sshd_config faulted-sshd_config
sed /^AllowUsers/d faulted-sshd_config > sshd_config
reboot
3) stop bubba2 and restart it with the install-usb-key in.
I am aware of the possibility to alter DO_INSTALL=0 in the installer file bubba.cfg in order to be left with a simple "rescue system". However, I cannot figure out what it means practically since interactivity is not existent as far as I can understand.
I am also aware of the possibility to use a serial connection (I have in hand a linux-recognised usb-serial adapter) but I wonder how the link can be established without any possibility to ad hoc configure the server itself.
So, this was just to explain why I am trying to divert the installer from its intended use!
Many thanks in advance for any advice regarding my proposal, and any other proposal if mine results to be over-simplistic.
Second: here is my problem and one idea to solve it that I kindly submit to bubba-linux-experts.
- My first (inferred) mistake was to put a comma in the "allowed users" list in /etc/ssh/sshd_config.
- My second mistake was that, although I have automatic backup on a nice "bubba-storage" unit, I forgot to save system files(!)
- Consequence: no user is allowed anymore to open a session on bubba2 via sshd. The situation is the same as closing one's home door leaving the keys inside! To make it worse, I am really afraid of loose my unsaved (heavy) system configurations!
After reading old posts on this forum and inspecting the contents of the "bubba.img" on the bubba2 stick installer, I wonder whether the following has a chance to work without destroying my system:
1) loop-mount on /mnt the "bubba.img" read from the usb-stick
2) replace /mnt/bin/bubbainstall.sh with the following:
#!/bin/sh
mount -t ext3 /dev/hda1 /mnt
cd /mnt/etc/ssh
mv sshd_config faulted-sshd_config
sed /^AllowUsers/d faulted-sshd_config > sshd_config
reboot
3) stop bubba2 and restart it with the install-usb-key in.
I am aware of the possibility to alter DO_INSTALL=0 in the installer file bubba.cfg in order to be left with a simple "rescue system". However, I cannot figure out what it means practically since interactivity is not existent as far as I can understand.
I am also aware of the possibility to use a serial connection (I have in hand a linux-recognised usb-serial adapter) but I wonder how the link can be established without any possibility to ad hoc configure the server itself.
So, this was just to explain why I am trying to divert the installer from its intended use!
Many thanks in advance for any advice regarding my proposal, and any other proposal if mine results to be over-simplistic.