CecilWard
Posts: 39
Joined: Sat Sep 03, 2016 10:17 pm

Locked myself out - no ssh and no keybd / screen available

Thu Sep 07, 2017 2:25 pm

I suspect I have screwed up the config file for ssh on raspian. I was able to ssh into my pi fine, now ssh client refuses to connect. I am partially disabled and don't have a screen or keybd - I was using ssh for everything before. The box is pingable at its usual IPv4 address (over ethernet).

Is there any way to get into the pi remotely over the network to fix the problem ? I am assuming however that it could be fixed if I can find a friend who has a suitable keyboard and display though.

User avatar
B.Goode
Posts: 8864
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Locked myself out - no ssh and no keybd / screen available

Thu Sep 07, 2017 3:10 pm

Sorry to learn of your dilemma. And I acknowledge having read back to learn of your health issues which must be borne in mind by anyone replying.

SSH is only one of the ways to access an RPi running Raspbian over the network. But the others such as vnc and RDP probably need some prior configuration on the RPi and are thus not useful in your current situation.

I think you may need someone to prepare a new ssh-enabled microSD card for you and help you load it into the RPi. (Or, as you say, lend you a screen and keyboard to use with your RPi.)

That might be sufficient. If you really want to regain access to the 'broken' microSD card you could use the 'new' system as a rescue station to gain access to the original card mounted in an external card reader dongle and repair whatever damage you did to the ssh configuration. The original could then be used to reboot the RPi again.

I'm sorry not to be more encouraging, but if there was an easy way you could have used that to have got started in the first place...

CecilWard
Posts: 39
Joined: Sat Sep 03, 2016 10:17 pm

Re: Locked myself out - no ssh and no keybd / screen available

Thu Sep 07, 2017 9:03 pm

Many thanks. I just wondered if there are other protocols available that I could exploit for remote management. (Since I have good usernames / passwords.) I don't have the box's innards exposed as a file server, so I can't use a remote file system to examine/repair that config file. Well not that I know of, not unless there was anything I don't know about just working by default.

Old-fashioned Telnet also for example. I did try that briefly, I think. I should have checked which port to try.

User avatar
B.Goode
Posts: 8864
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Locked myself out - no ssh and no keybd / screen available

Thu Sep 07, 2017 10:23 pm

Raspberry Pi Foundation documentation for Remote Access is here: https://www.raspberrypi.org/documentati ... te-access/

CecilWard
Posts: 39
Joined: Sat Sep 03, 2016 10:17 pm

Re: Locked myself out - no ssh and no keybd / screen available

Fri Sep 08, 2017 6:12 pm

I believe the pi will accept a login over (some sort of) serial port by default? Is that correct?

I don't know whether the pi h/w uses correct RS232 voltage levels, or just has a device that is waveform-compatible with standard UARTs but using say 0 / +5V or whatever, not the rs232 levels.

I seem to remember having seen hardware and software for Apple iOS that can provide console login and access serial hardware of devices such as routers. I wonder if that could be an option for me to get myself out of this hole? (And thinking ahead to the next time I do a similar thing by similar stupidity.)

User avatar
rpiMike
Posts: 957
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Locked myself out - no ssh and no keybd / screen available

Fri Sep 08, 2017 6:25 pm

If you've got access to the Pi's sd card, you can put the card in a PC/Mac and edit the /boot/config.txt.

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Locked myself out - no ssh and no keybd / screen available

Fri Sep 08, 2017 7:33 pm

CecilWard wrote:
Fri Sep 08, 2017 6:12 pm
I believe the pi will accept a login over (some sort of) serial port by default? Is that correct?

I don't know whether the pi h/w uses correct RS232 voltage levels, or just has a device that is waveform-compatible with standard UARTs but using say 0 / +5V or whatever, not the rs232 levels.

I seem to remember having seen hardware and software for Apple iOS that can provide console login and access serial hardware of devices such as routers. I wonder if that could be an option for me to get myself out of this hole? (And thinking ahead to the next time I do a similar thing by similar stupidity.)
The RPi has a UART serial port that works on 0-3V3 levels NOT 5V and NOT RS232. If you connect the RPi to a device with a 5V UART then you will need a 3V3 to 5V level shifter between.
If RS232 then you will need a TTL to RS232 module based on MAX3232 chip running at 3V3 and NOT MAX232 which is 5V.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

CecilWard
Posts: 39
Joined: Sat Sep 03, 2016 10:17 pm

Re: Locked myself out - no ssh and no keybd / screen available

Sat Sep 09, 2017 10:18 am

Thanks for that warning, very useful. I assumed that the hardware to produce the real rs232 voltages probably would be missing. My goal would be to interface to an iPad over wifi ideally, or else Bluetooth. I have seen hardware products that convert some kind of serial comms ports [unknown] into traffic over either wifi or Bluetooth, with companion apps for iOS. I read about the users of such products using an iOS device to talk to eg Cisco routers' console ports via a wireless Lan, but I don't know what species of serial hardware it was in that case. So I'm not sure I will be able to find a suitable device to interface to an iPad, not without a second piece of hardware in the middle anyway, needed to do voltage conversion.

I once wrote the software for a new serial interface module, it's device driver and accompanying comms utility app for a new small handheld computer, many many years ago, so I am familiar with max232 chips, old faithfuls.

Return to “Troubleshooting”