Tty or SSH-access on a RPi2

Hello!

Been browsing the forums for a solution to my accessing shell on my OSMC running on a RPi2.
But no luck. Hope someone has time to help…

SSH on RPi2 is refusing connections. using extraPutty. Tried both wireless and wired connection to the router.

Ping works fine.

Tried using escape-key on the RPi-keyboard. Then a small image with three dots shows up, but bootup continues anyway.

Using crtl+alt+f2 gives me a tty, but bootup continues and i dont have time to user the tty

Any suggestions to what else to do more, or what in my list can be retried in a different way.

Is the SSH-server on by default? Can I access something from within Kodi (like a add-on) to get access to shell?

//Lihapall

SSH is on by default, so if it somehow got disabled, that’s a bug.

To log into a local console, choose EXIT from the kodi menu, wait for the OSMC splash screen to appear then press the ESC key.

You have 30 seconds to log in as osmc / osmc.

When logged in you can re-enable SSH by doing:

sudo systemctl enable ssh.service
sudo systemctl start ssh.service

We have seen a couple of reports of the ssh server being unexpectedly disabled after running updates but have not been able to reproduce it. It’s quite possible that it is a result of all the package reworking that has occurred since Alpha 4 so it should be fixed in the RC.

If you see ssh mysteriously disabled at any point after the RC release please let us know.

1 Like

Thanks a lot DBMandrake.

The exit-option, and then when logo appears, pressing ESC worked fine…

logged in to find that…

sshd was disabled (checked with ps -aux | grep sshd). I’m running Alpha4 so its not a mystery then yet…

But your commands to get sshd back up worked like a charm, and seemed to “stick” as well after reboot :slight_smile:

To check service states in systemd you can use a command like:

sudo systemctl status ssh.service

This will tell you if the service is enabled or disabled on boot, currently running, and any recent output from the service.

Was it after a fresh install or an upgrade that you lost ssh ?

Upgrading in Alpha 4 is pretty broken now due to package re-organisation for the RC and isn’t recommended as you’ll get a mishmash of up to date and out of date packages.

Hey,

Most likely have updated while playing around in the menues (I’m not 100% sure though). But because i needed to reinstall the whole system, using the same image, ssh works from scratch now…

Well after see manual and this post (and anothers) i think the bug it’ on latest build RC2.

  1. Network wired not work for me with DCHP or Manually setup.
  2. Network wifi work fine with DCHP, but SSH it’s down or bad setup.

With this, I can’t access without keyboard and screen.

I’m looking for any solution, such:

  • cmdline.txt
  • config.txt
  • preseed.cfg

But not look any solution.

I run my own raspberrypi2 and mount card with OSMC.
I see that ssh it’s not enable on default boot system. With this setup, OSMC it’s not good for people that use RasbperryPi without keyboard and screen (such Apple users for example).

The solution are, create simbolic link on /<path_mounted_osmc_card>/etc/init.d/rc*.d/ to ln -s …/init.d/ssh S02ssh

With this, ssh up at start OSMC. Apreciate ssh service up by default on next releases.

NOTE: Verify problem for ethernet on RaspberyPi2 (work fine for 2 months) with a NOOBS with wired and wifi (DCHP or IP fixed). Try create OSMC with version wired, and not work (either DCHP or IP fixed). Tested with nmap.

I suspect these are due to some local issue on your end. They are not widespread or widely reported as you can see in this forum. SSH has always been enabled by default in OSMC. If it’s not working then there is something strange going on in your system, possibly some file system corruption. Re: the networking issues, this may be due to some network hardware specific config on your network or maybe something to do with the NOOBS install. I suspect a fresh install might resolve most of this.

SSH is, and always has been, enabled by default on a fresh install.

Regarding your Ethernet not working - this is either going to be low voltage to your Pi 2 (do you see the small rainbow icon in the top right of the screen ?) or some hardware issue.

There is no software reason why Ethernet would not be working on a fresh install.

Please try a fresh install using the OSMC installer on our website instead of the Noobs installer and let us know if you still see the same issues.

Hi.

Got o OMSC page.
Download installer for MacosX and image (today at 08:00 GMT)
Run installer.

  • Try wired
  • Try wired manually setup
  • Try Wifi
  • Try wifi manually setuo

On any case, SSH it’s up. Impossible up, but if not in /etc/rc*.d/ level file for UP ssh service, service sshd not startup.

For problem with wired network, solution, are clean DCHP ruter because any asignation to mac conflict with DCHP server and on fixed ip same problem.

For problem with “Always SSH server enabled but not work” my post contain solution. (solution = If not correct files on sys debian startup system, ssh not enable by default)

Best regards.

OSMC does not use initd, it uses systemd systemd - Wikipedia

I’m sorry, but I have no idea what you are saying here…

As @actiona says, OSMC uses systemd so you are looking in the wrong place for service startup scripts. The service unit for ssh is at /lib/systemd/system/ssh.service and as I have repeatedly stated, is definitely enabled by default on a fresh install. Honest. No kidding around. :wink:

You can check like this:

osmc@osmc:~$ sudo systemctl is-enabled ssh.service
enabled

Are you saying that you first manually configured IP settings in OSMC networking settings, and that you then tried to assign the same IP address using a static reservation on your DHCP server ?

In that case, yes there is a known bug that would cause you to get no IP address if a previous static IP configuration exactly matches a DHCP allocation. This bug is fixed in the latest updates or in RC3.

I have been having trouble with RC3. I found that by uninstalling and then re-installing SSH server I was able to gain access. I am trying to set up a VPN. Beyond thee initial access it stops working and refuses to accept the password (osmc).

It would be great if OPENVPN was installed by default, and run a t boot up. Te resources used would be small but provide a great option for end users.

regards,
K718

SSH is enabled by default and nobody has really reported any problems with SSH (maybe 1-2 people) so there is an issue there that needs further troubleshooting on your system.

There’s really no point in us having OpenVPN installed by default - it is still going to need a lot of manual configuration to set it up anyway, sudo apt-get install openvpn really isn’t that hard, and avoids the base system install from becoming too bloated if we throw everything including the kitchen sink in - you’ll notice that Samba is no longer built in like it was in Raspbmc for exactly this reason.

I have OSMC R3 installed a P1 and a Pi2 and cannot ssh into either from my MacBook. I did manage it once on the Pi 2, and installed OpenVPN successfully. Since then I have failed o access either Pi. I am using Spacke, xTerm and terminal problems without success.

Any idea what is going on would be appreciated.

K718

Please upload your debug logs using the log uploader in OSMC settings - otherwise we can only guess what the problem could be.

uploaded to http://paste.osmc.io/ubelegaraz

hope this helps

Jun 11 13:17:28 osmc sshd[550]: Did not receive identification string from 192.168.1.110
Jun 11 13:17:32 osmc sshd[555]: Connection closed by 192.168.1.110 [preauth]
Jun 11 13:17:49 osmc sshd[558]: Connection closed by 192.168.1.110 [preauth]
Jun 11 13:18:35 osmc sshd[564]: Connection closed by 192.168.1.110 [preauth]
Jun 11 13:18:46 osmc sshd[567]: Did not receive identification string from 192.168.1.110
Jun 11 13:18:46 osmc sshd[568]: Connection closed by 192.168.1.110 [preauth]
Jun 11 13:18:54 osmc sshd[574]: Connection closed by 192.168.1.110 [preauth]

This is saying that the client did not send an indenficiation string during the preauth stage - most likely this is an issue with the ssh client. Can you try ssh’ing from a different machine ?

Are you using the command line ssh client in Mac OS or a GUI app ? I just tried an ssh connection from the command line ssh client on a Mac running Yosemite and it connected perfectly:

MacServer:~ dbmandrake$ ssh osmc@rpi2.local
The authenticity of host 'rpi2.local (10.0.11.31)' can't be established.
RSA key fingerprint is 41:34:18:91:15:ed:ac:b8:16:28:a6:cb:ea:5e:d4:db.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rpi2.local,10.0.11.31' (RSA) to the list of known hosts.
OSMC: Open Source Media Center
osmc@rpi2.local's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Jun 11 14:53:27 2015 from 10.0.14.147

I am using 10.8.5 on my Mac. sounds like it might be my mechine.

I have used spackle, xterm and terminal to try to ssh to my Pi’s. I might try a windows machine next. Is the a way I could check my ssh on the Mac?

Thanks for your patience. You can guess that I am not that experience on linux, or most command line codes. Just trying to learn.

thank you

update - 17:14 local.

have managed to access my Pi not the Pi 2. through terminal. now installing OpenVPN.

I think a previous session is still running on the Pi 2, as I don’t think I exited properly.

Hi, I have now resolved my ssh problem as I had not executed the session properly and not used terminal correctly.

I have installed OpenVPN using Brian Hornsby’s guide. All steps completed and checked. However I cannot get OpenVPN to run.

The guide was written for RaspXBMC so I used sudo bash to get to osmc@osmc (root?).

I then followed the instructions.

I also used his addon to configure the system. Still no joy.

Is there an addition command line I need or do I need to edit the boot file to start the VPN on initial boot?

Thanks for your patience. If I do succeed I might write a guide solely for OSMC.

If is a big word though.

regards, Kris

Hello
I have the same issue.
downloaded OSMC and updated everything and rebooted but I can connect to SSH.
If I use PuTTY I get “Network error: Software caused connection abort”
If I use Bitvise SSH Client I get: “the SSH2 session was terminated with error Reason: FlowSocketReader: Error receiving bytes, Windows error 10054: Connessione in corso interrotta forzatamente dall’host remoto” (sorry for the Italian)

For strange as it could be, I do not have a usb keyboard. Do I have to buy one to solve?
Thanks!
Andrea