# Logging into resinOS without internet connection

**URL:** <https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570>\
**Category:** Product support\
**Tags:** ssh\
**Created:** [August 3, 2017, 7:19pm UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570 "2017-08-03T19:19:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/michael/32/521_2.png) [@Michael](https://forums.balena.io/u/Michael)\
**Post date:** [August 3, 2017, 7:19pm UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570/1 "2017-08-03T19:19:38Z")

</div>

I’m trying to log in into raspberry without internet to debug my app’s behaviour when there’s no connection, and I would like to figure out the proper way. The resinOS image is the one generated by [resin.io](http://resin.io). What I have noticed is `resin-rootA/home/root/.ssh/authorized_keys` points to `/var/lib/dropbear/authorized_keys`, but there is no `/var/lib/dropbear` folder. Am I supposed to created it and put `authorized_keys` with my public key into it?

---

<div class="post-metadata">

**Author:** ![daniel.lee](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@daniel.lee](https://forums.balena.io/u/daniel.lee)\
**Post date:** [August 3, 2017, 7:41pm UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570/2 "2017-08-03T19:41:04Z")

</div>

Our team had similar requirement as you described, and we decided to install openssh to easily ssh into our devices, with or without internet. [https://github.com/resin-io-projects/resin-openssh](https://github.com/resin-io-projects/resin-openssh) was a great resourse.

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/michael/32/521_2.png) [@Michael](https://forums.balena.io/u/Michael)\
**Post date:** [August 3, 2017, 9:27pm UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570/3 "2017-08-03T21:27:22Z")

</div>

I would like to ssh directly into the host machine, because sshd is already running, it just doesn’t let me in. I wouldn’t like to mess with Dockerfile and run yet another ssh daemon, if it’s possible to do without.

@imrehg, can you please share how did you ssh into raspberry host OS while debugging the issues we were discussing in the [other thread](https://forums.balena.io/t/raspberry-pi-resets-every-40-seconds-if-offline)?

This is what I get so far:

```auto
$ ssh root@51a368b.local -p 22222
Permission denied (publickey).

```

The bonjour service on my mac claims `51a3868b.local` advertises ssh access:

```auto
$ dns-sd -B _ssh._tcp .
Browsing for _ssh._tcp
DATE: ---Fri 04 Aug 2017---
 0:57:43.469 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
 0:57:43.471 Add 2 4 local. _ssh._tcp. 51a368b

```

I even tried

```auto
Host 76138b8.local
  IdentityFile ~/.ssh/id_rsa

```

in `~/.ssh/config`, but with no luck.

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/michael/32/521_2.png) [@Michael](https://forums.balena.io/u/Michael)\
**Post date:** [August 4, 2017, 7:01am UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570/4 "2017-08-04T07:01:17Z")

</div>

I managed to login with [https://github.com/resin-io-projects/resin-openssh](https://github.com/resin-io-projects/resin-openssh) approach, but I’m still curious how to log in into host OS.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 4, 2017, 10:12am UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570/5 "2017-08-04T10:12:17Z")

</div>

If you are using a `.dev` machine, that has the SSH port open, so you can just log in with `ssh -p 22222 root@<device addres>`, no password. This is only for `.dev` versions of resinOS, and would really recommend using the `.dev` for troubleshooting

And there _is_ a `/var/lib/dropbear/authorized_keys` file. The symlink is using absolute path, and when you mount the SD card, then it would point to that path on your computer, obviously do not exist there, but should understood that path as from the mount mount of the SD card. So for example on my machine the card is mounted at `/run/media/gergely/resin-rootA`, then the file will be at `/run/media/gergely/resin-rootA//var/lib/dropbear/authorized_keys`.

Please note, that it’s on the host’s roofs, and that partition on production devices is not expected to be modified, thus on resinOS host updates the modifications would be lost (hence our recommendation to use .dev images for development and testing).

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 4, 2017, 10:41am UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570/6 "2017-08-04T10:41:19Z")

</div>

Also, on the other thread you linked to, I did not SSH in, I used the serial console, as mentioned, which is available only on `.dev` devices, and used that because it’s independent of the network. Hope this helps to clear things up!

---

<div class="post-metadata">

**Author:** ![sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sam](https://forums.balena.io/u/sam)\
**Post date:** [March 7, 2018, 6:00pm UTC](https://forums.balena.io/t/logging-into-resinos-without-internet-connection/1570/7 "2018-03-07T18:00:05Z")

</div>

If I am understanding you correctly. It is possible to do the following:

1. Add a key to …/authorized\_keys
2. Use that to SSH into the host OS of freshly flashed SD cards
3. Using command line tools, interface with network manager and setup/update IPs
4. Update the host OS (assuming the original instal was an outdated version) and remove the ability for people to SSH into our devices?

If so this will actually be perfect for our remarkably specific use case.
