Raspberry Pi via ssh

So up until this point we have our Raspberry Pi connected to the monitor and have a second mouse and keyboard lying around, which is not very practical isn’t it? This article will show you how simple it is to connect to your Raspberry Pi over ssh and get rid of that redundant keyboard, mouse and free up your second monitor!

Requirements:

  • Raspberry Pi and your computer MUST be on the same network.
  • your computer must be on
  • your Raspberry Pi must be on
  • you must have your routers login and password
  • PuTTY

So the first and most radical step is to disconnect the Raspberry Pi from the monitor you have and disconnect the mouse and keyboard from it, only leave the Ethernet and Power connections. Now your desk will be clutter free again!

Now it’s time to connect to you router and find out what is your Raspberry Pi IP on your local network (this is why your PC and Raspberry Pi must be on the same network).

Most routers default local ip adresses are 192.168.0.1 or 192.168.1.1, so try  both of them, just copy the from here to your web browser and go to it.

Mine was http://192.168.1.254/, it was different because I am accessing it over an access point.

router home page

You should see something like this, it may be different dependent on your routers model. Mine is Pirelli DRG A125G.

So now you must login to your router, by default most routers logins are  admin  or administrator, and the password may be no password at all, admin  or administrator, if you’ve tried them all and with no luck, try looking on the router it self form the login and password, many ISP’s provide a sticker with login credentials, try googling your router model and it’s default credentials, or try and contact your ISP for them.

So i assume that you’ve logged in to your router, now you need to find a network map where it list all the connected devices to it. In most cases it’s your routers main page, so you don’t have to look for it.

network map

In my case it was the first page after logging in. Now in the “Local Network” window we can see a device named “raspberrypi”, it’s our Raspberry Pi, it’s name liked this by default, so you should find it easily.

In this case, my Rasberry Pi local IP address is 192.168.1.64, your’s most probably will be different then mine, so write it down, we will need it later.

Now after writing down your Raspberry Pis’ local IP address you can close the routers’ web page.

Now you’ll have to download a SSH client if you are using windows.

I highly recommend PuTTY, you can download it from here.

Download it and launch the exe file.

putty 1

A window like above will appear, and just fill it in with your Raspberry Pi IP address like I did, Port 22 and SSH will be chosen by default. Now just click Open.

putty 2your login by default it “pi” and the password is “raspberry”, when you’ll be typing the password in, down be afraid if star(*) symbols won’t appear, it’s a terminal and a security thing. Just type it in and hit enter and BAM! we are in! Now we are connected to our raspberry pi an we can do anything we want.

First of all, I highly suggest we change the users password for a more secure one, because in future tutorials we will be exposing our Pi to the internet!

Just input this command to PuTTY:

passwd

Type in you current password which is “raspberry”, and type/retype a new password.

And this is what you’ll get if you’ve done everything correctly:

putty 3And this is it. If you have any questions or suggestions, feel free to leave them in the comments or write me an email to paulius@janciukas.lt

In the next article I will explain how to forward you’r ports and create a Apache server and a website for everyone to see.

5 thoughts on “Raspberry Pi via ssh”

  1. 1) mount raspberry’s SD card
    2) configure static IP instead of DHCP
    3) paste your’s public key to .ssh/authorized_keys
    4) setup sshd to accept logins with key only
    5)….
    6) Profit.

    Also, apache + php is a liitle heavy, for RPi Lighttpd/nginx works much better.
    Also putty is… wtf. Plenty of tools work much better, you can start with cygwin or git install part of it.

    1. Apache+php is fine for personal use, and Pi can’t handle heavy loads of networking, because it doesn’t have Gigabit. Still i will try out Lighttpd/nginx.

      Putty is more then fine in my case.

      Care to explain more about the process you are talking in the first case?

      1. Just noticed that you are using second generation RPi, the first one was struggling a little with a let’s say Apache running wordpress on it.
        Btw, RPi would not handle 100 mbps traffic anyways not because of the interface, but just because Apache just won’t work that fast on RPi’s hardware. 🙂

        Putty sucks because you can’t copy files and do most of other stuff over ssh compared to “unix-like” environment. Let’s say you want to copy file from computer to RPi, you would have to use something like Filezilla for SFTP connection and with cygwin or any other unix-like environment you just could use “scp file.txt user@pri_ip:~/” much faster.

        Half of your post consists of checking the IP of the RPi. To avoid that you could use static IP configuration. In my home network I use 192.168.1.100-150 for static eth connected devices, 151-200 – static wireless, 201-255 – DHCP devices. So in that way all my computers, NAS other devices that I need to connect to ALWAYS will have the same IP and I will be able to connect to them without checking it. Devices that I don’t care about (phones, tablets, eReaders, random-shit) will have an ip in range of 201-255 and.
        Second part is keys. Passwords sucks. So in linux world we use keys, signatures, certificates.
        https://help.ubuntu.com/community/SSH/OpenSSH/Keys
        Idea is that you would have a key(s) in your computer(s) and only would be able to login to the server(rpi) using them. Not a ‘must’ for local network, but if you are going to open ports for external use – I would say a must.
        Also this is a good to do things as they should be done just for practice.

Leave a Reply

Your email address will not be published. Required fields are marked *