I have installed my first app successfully in my Balena dashboard and all is running well. However, I cannot SSH to it on the local lan 192.168.1.64 using either port 22 or 22222. I am running MacOS 10.14.6
I have followed the instructions on generating SSH key, but I cannot connect when running ssh root@192.168.1.64, but
with the -p22222 switch I get ‘Permission denied (publickey).’
with the -p22 switch I get ‘port 22: Connection refused’
I have copied the key using ssh-add -K ~/.ssh/id_rsa and pasted that into my balena dash preferences. Any help or pointers for a noob much appreciated!
Hi Visionist, welcome to our forums. There are a few ways you can SSH into a device:
Using the CLI, balena ssh <device>:
For production images, this will require your public SSH key to be added into your preferences.
For development images you don’t need SSH keys added as long as you are on the same LAN.
Using SSH client, ssh -p 22222 root@<IP_ADDRESS>:
For production images, this requires you add your public SSH key to the config.json file on the device
For development images again you don’t need SSH keys as long as you are on the same LAN.
Via the dashboard, without the need of setting up SSH keys regardless of your production/development flavour.
In your case there are a few things that might be causing trouble:
The key you copied is probably your private key (usually named id_rsa), you need to copy the public key (usually named id_rsa.pub)
Even if you copy the correct key, I think that you are running a production image so it won’t work as you need to put it in the device config.json.
BTW, you can read more about SSH with balena devices here: https://www.balena.io/docs/learn/manage/ssh-access/
You’ll find detailed explanations for all this, including editing the config.json. However, if you are just starting out with balena I recommend you use development images until you are comfortable, just for the ease of use.
Many thanks. I ended up in this pickle because I was simply trying to replace the splash screen image and I can’t work out how to copy a file my local machine in the balena cloud dashboard terminal session.
That’s also why I was trying to get SSH working, so I could easily edit the config.txt file from an SSH client like CyberDuck, without using the command line, which is relatively new to me (or it’s been a few years!).
Is it possible to use the CP command from within a browser terminal session from a file on my local machine to the resin-boot/splash folder?
Also, is it possible to convert a production image to a dev one?
Hi. No, you cannot copy to the resin-boot/splash folder. If you want to do that, then you should be modifying the image before you burn it to the SD card so that you have the change on all the SD card that you write.
Also, you cannot convert a production image to a development image.