How to install Snappy Ubuntu Core without a keyboard
I bought a raspberry pi 3 to use as a server, and only after getting part way through the Ubuntu Core installation instructions did I realise that I actually don't own a USB keyboard... (we're a laptop household) Oops.
I can boot the raspberry pi and see it on the network, and its SSH server is up and running, but obviously it doesn't know my username or SSH keys and so won't let me log in.
Is there some way to get it working by editing files on the SD card with my main laptop then SSHing in? Or do I actually need to go out and acquire a keyboard for this 60 seconds of use?
Solution 1:
Updated Answer
As of Ubuntu Snappy 16.04 , things have changes quite a lot. During the first boot you will need to have physical connection to Snappy. Best approach is via serial cable and screen
( see my old answer for details ) to configure it first, and then log in via ssh.
At first boot you will be able to configure wireless connection and register your Raspberry with Launchpad ( aka Single-Sign-On ) username. This means that you have to have your laptop's/desktop's ssh
public key registered on Launchpad. So for this part what you need is this:
- Have Launchpad ID created
- Generate ssh keys with
ssh-keygen
- Copy your
~/.ssh/id_rsa.pub
to Launchpad. - Now connect to Raspberry ( via serial cable or keyboard + monitor approach)
- Configure wireless, configure your admin account. At this point Raspberry will contact Launchpad and get your ssh public key. You will be told with which username and ip address you can ssh into Raspberry.For example for me it was
[email protected]
, so I didssd [email protected]
. Because Raspberry knows your ssh public key, first ssh login will not require password.
These steps are pretty much shorter version of Ubuntu's official documentation, but the steps explained exactly as I followed them. I did run into a bit of issue where I had this error from ssh
during first log-in:
sign_and_send_pubkey: signing failed: agent refused operation
This can be solved with simply running ssh-add
.
Old answer ( relevant for pre-16.04 releases )
Let's assume your Raspberry Pi's ip address is 192.168.0.25
. If you're trying to just run
ssh 192.168.0.25
It will obviously assume you're trying to log in with the same username as what you use on your laptop/desktop. But what I see from your question is that you just installed Ubuntu Snappy onto the SD card and booting the Raspberry. This means you can ssh into it with default username and password, both are ubuntu
:
ssh [email protected]
Thus, you don't really need USB keyboard for that. USB keyboard would be necessary only if you've connected Raspberry to a monitor and trying to log in same way as on desktop/laptop.
Another things you can do is acquire USB serial cable and log into it via serial console using screen
. This is personally what I do if I don't need to do anything network-related on my Raspberry. The slight nuance is that you need to properly connect pins on raspberry and use only USB 2.0 port on laptop/desktop. Once connected, Raspberry will power up, and you can issue a command:
screen /dev/ttyUSB0 115200
where /dev/ttyUSB0 is device file represented by your Raspberry and 115200 is the baud-rate, or speed, of transmission between the two machines. Keep in mind that ending number of the device file may be different ( but in my experience it usually starts out with 0).