Difference between revisions of "RPi A Method for ssh blind login"
m (moved A Method for ssh blind login to RPi A Method for ssh blind login: move content to RPi specific title)
Revision as of 11:47, 13 July 2012
This wiki page describes a method for logging into a fresh out of the packet RaspberryPi when the user has a Networked computer but no suitable monitor for the RPi.
Note for those not monitorialy challenged.
If you have a monitor attached to your RPi you can still do all this stuff and your RaspberryPi will still run with or without an attached monitor.
In fact you can be logged in localy on your pi and at the same time be logged in from an external PC using putty and if you fire up startx from the putty login startx will run on your HDMI output.
This example uses and recommends Putty as the client software this is by no means the only available ssh client. It is however freely available on line for a wide range of operating systems, is open source and happens to be the one I have used. :)
In the example quoted the student was using a "Virginmedia Super Hub model number VMDG-480"
The Router/Hub address
It appears that this Virginmedia Hub is a re-badged Netgear so like most (note not all) Netgear routers/hubs the DHCP embedded in the router/hub software should issue IP addresses that follow this pattern.
If this is the case the hub probably uses 1 in place of the x as it's own address. Making the hub address 192.168.0.1
The primary computer will probably use 2 giving it the address of 192.168.0.2 and the then the later ones will follow in sequence.
For example I happen to know that a "Zoom X6 ADSL Router" uses an address of 10.0.0.2 so a Warning here if the method using 192.168.0.x does not work and your router/hub is not Virginmedia or Netgear or some other re-badged Netgear then its likely that your router IP addresses lie in some other range.
You may have to resort to reading the manual (shock horror) for your router/hub.
Using a wrong address is highly unlikely to damage your hardware, this is more akin to dialing a non existent number on your telephone (you just will not get an answer).
Given a choice of operating systems for hosting the Putty client I prefer Windows XP and Ubuntu followed by almost any other Linux distro before resorting to Vista or Windows7 purely on grounds of ease of instalation I cannot speak for Mac issues but I am given to believe Cyberduck is an option.
If you have putty installed on a Windows7/Vista machine go ahead and use it (my concerns only relate to getting it installed and getting it running)
Get Putty ready
This is a screen shot of a Windows XP Putty login screen but the Ubuntu and other versions are not that different.
Note this is a screen shot of a copy that has a saved session when you first start the "Host Name (or IP address)" box will be blank
The Saved Sessions box will be blank and there will only be "Default Settings" in the saved sessions largebox.
The entry shown was taken after I had saved an earlier session where I had provided the name RaspberryPi do not expect this to fill in automatically it is not that magical.
You will need to your RPi connected to your router/hub with a 10baseT (ethernet) patch lead. You may have received one with your router.
If you want to connect using a wi-fi connection for the RaspberryPi thats a whole other ball game and will require it's own Wiki page and a bigger geek than me.
You will need your Wheezy imaged SD card inserted and then power up the RPi.
On your RPi next to the usb sockets there's a set of tiny led's wait till you have at least a steady lit yellow two greens and a red this may not be essential but I'm sure it's good practice.
Ready to start.
Ok go to your putty screen as shown above and type in 192.168.0.3 leave the port address of 22 as it is. It may be worth mentioning if you have managed to connect other devices to your router/hub for example smart phones the last digit will probably be 2 more than the number of existing devices. Be prepared to try other values.
Make sure the radio button SSH is selected
In saved Sessions type in RaspberryPi (you can type anything you like here but RaspberryPi seems sensible) Also select the radio button for "Only on clean exit" (not essential but again a reasonable choice)
Click the save button that will just give you a shortcut to those settings your putty should now look like the image above however the IP could well be different.
If you get a terminal window and the following warning screen overlaid that means you have the connection if you click "yes" it will be the last time you see this warning unless you re-image the SD card.
If you do not see the warning and the connection times out try other values for the last digit don't go wild it's unlikely a home user will have a lot of wi-fi connections so the last digit is liable to be single figures.
Ok if you have this right the line Login: will appear in the terminal window. enter pi and wait till it asks for a password then type raspberry
Remember this is using the clean install of wheezy the login and password will still be the default settings.
If your screen then looks like this (numbers and codes will probably differ) you have been sucessfull
You have a connection to your RaspberryPi
Some general information to wrap up
Like I say you may need to experiment with changing the last digit in the sequence 192.168.0.x if you only have an Ubuntu computer and a Windows7 PC connected then 4 is the most likely but if you have smart phones picking up wi-fi from your Hub look at it being two more than the number of devices connected (remember the hub itself is number 1)
Timed out connections probably mean you have the wrong address and obviously you are looking for the next free number. Don't forget the RPi may even be using 0,1 or 2 if you get a windows style pop up window and pi as a login and raspberry as a password do not work you may actually be trying to log into the router.
Don't worry it just won't connect unless you have a weird router with a login of pi and a password of raspberry.
make a note of the following commands
shutdown -h -H now
"sudo su" makes you the super user temporarily which will then let you run "shutdown -h -H now"
These are the two commands you want to use to do a safe shut down and you will not want these till you have a login as shown on the previous screen shot.
If you are using a genuine clean image of wheezey and you have the login prompt and pi and raspberry (note the password does not echo on the screen) appears not to be working you can be confident it is more than likely your typing feel free to try several times remember caps lock OFF because it is all lower case
Look at the window make sure you are not typing the password when it is asking for the login. :D
If you have failed and have decided to either re-image the SD card or just go off and read the router/hub manual again.
Try not to kill the power at the RPi end as you will be wearing out the socket.
I use a USB connection lead for a phone and I connect to either the PC or one of those cute plugtops with a USB socket so if I am powering down I unplug at the USB end not the MicroUSB end.
If you have run the shutdown command give it a while before you kill power as it looses and reports the ssh connection is down before it has acctually shut down the RPi.
I have found that with a HDMI connection this is about 12 seconds give it at least 20 seconds (Engineering estimate ref- Montgomery Scott, StarTrek)you should be ok.
Once you have the third screen shown above ignore the startx command it does start the X window but the output only goes to the composite or HDMI port whichever is connected.
You will not see it on your ssh screen it will lock up and because you cannot see the screen to shut it down.
Note you do not need a Mouse or a Keyboard connected to the RPi
Enter the command
You will get the menu that I talk about in the wiki page raspi-config menu (DO NOT TOGGLE ssh It will cut you off) use the up and down arrows to highlight the menu entries and enter to select when you are finished
will drop you back to the command prompt
This links to a Wiki page with instructions on building a LAMP web server LAMP You will not need a Composite monitor or HDMI to run this and it will give you more than command line stuff.