New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Can't SSH into B3

Got problems with your B2 or B3? Share and get helped!
Post Reply
Clive
Posts: 164
Joined: 07 Mar 2007, 07:15

Can't SSH into B3

Post by Clive »

I messed up whilst trying to configure my B3 to allow SSH logins via certificates.

End result, I can no longer SSH into my B3, I get "Permission denied (publickey)."

I know what I did wrong in the ssh_config settings, but can anyone think of a way I can access that file without being able to SSH into my B3 ?

Is there a way I could boot via a USB stick into a minimal Linux OS ? I have been wracking my brains trying to work out how to move forwards.
MouettE
Site admin
Posts: 341
Joined: 06 Oct 2011, 19:45

Re: Can't SSH into B3

Post by MouettE »

Yes using a rescue key is the better option here. You can download the latest bullseye installer here : http://install.excito.org/bullseye/latest/b3/ . Unzip it onto a FAT usb drive, and edit the install.ini file to comment or remove the whole [general] section at the end of the file. You can then boot the b3 with it and connect with telnet or ssh once it's connected to the network (user/password is excito/excito).

Once you're into the box, mount the disk main partition and do the changes you need.
Clive
Posts: 164
Joined: 07 Mar 2007, 07:15

Re: Can't SSH into B3

Post by Clive »

Thankyou !

I got lucky and remembered I was running a desktop on it and was able to login via VNC and correct my sshd_config.

But a lesson learnt for next time I try to mess with SSH configurations without truly knowing what I am doing.
fredrikj
Posts: 45
Joined: 27 Jul 2011, 12:31

Re: Can't SSH into B3

Post by fredrikj »

There is a neat trick to fearless editing of ssh-configurations: Use two ssh-sessions.

Log in and sudo in two different terminal windows from your client. Edit the ssh config in one, continue to keep both terminals open and restart the ssh daemon from one of the terminals. Now you can either log out of one or open a new terminal locally and verify your configuration by attempting to log in from the new terminal. Keep in mind that you must keep at least one of the sessions established before restarting sshd open until the new configuration has been verified.

The trick is that the old sessions that were established before you restarted sshd will keep running with the config as it was before sshd was restarted. So you can almost always recover from a configuration mistake simply by rolling your edit back from one of the pre-established sessions.

Have fun, happy hacking!
Clive
Posts: 164
Joined: 07 Mar 2007, 07:15

Re: Can't SSH into B3

Post by Clive »

Good advice ! I will remember that. :-)
Post Reply