Skip to main content

Setting Up Your Raspberry Pi - SSH

Hello everyone!

So, Raspberry Pi?
Having problems setting up your little computer?

I'm here for the rescue!

Follow the procedure if you want to set up your Raspberry Pi through a SSH (Secure Shell) or as others call it the 'Headless method' and use Raspbian as your operating system. I would personally suggest to use Raspbian as your first operating system on the Raspberry Pi.

Watch the video for better understanding.



First of all, the hardware that you'll need is:
  • Raspberry Pi (I own a Raspberry Pi Model 3B)
  • Ethernet Cable
  • SD Card or Micro SD Card depending on your model of Pi (I'll use a 8GB Micro SD card)
  • Power Supply of ratings 5.1V and 2.5A max (I use my phone charger which has a rating of 5V and 2A)
  • Laptop/desktop PC (I'll be using a Windows 10 laptop)
Now coming to the software side:
  • Latest image file of the Raspbian operating system.
I'd recommend you to download Raspbian Jessie With Pixel because it has many additional features but if you want to save some space and just want to stick with the basic things go for Raspbian Jessie Lite, the procedure is same for both. Download the torrent file or simply go for the zip file.
Download Raspbian Image
  • SD Card Formatter
Make sure your SD Card does not have any important data on it because it will all be erased during the process.
Download SD Card Formatter
  • Win32 Disk Imager 
This will be used to burn the Raspbian image file on the SD card.
  • Notepad++
Download Notepad ++
  • Putty
Putty will help us in connecting to our Pi using SSH.
Download Putty

Now lets get to installing the Raspbian image to our SD card
  • Firstly extract the .zip file in a folder
  • Plug your SD card in your computer.
  • Now install SD Card Formatter and Win32 Disk Imager
  • Open SD Card Formatter and select the correct drive letter i.e of your SD card and from Options select Format Type -> Full (Erase) and in Format Size Adjustment -> On
  • Now Format your SD card.
  • Open Win32 Disk Imager and then locate the Raspbian image using the little blue folder icon.
  • Next, select your SD card in the Device list. Make sure you select the correct drive letter.
  • Click on Write and wait for the process to complete. It will give you a prompt 'Write Successful'
    To access our Raspberry Pi using SSH we will have to make some changes in the SD card. For that:
    • Browse to your SD card directory (Your card will be labeled as 'boot')
    • Create a new file called 'ssh'. This is done to enable SSH on your Raspberry Pi. In earlier distributions it was enabled by default but not in the new one. For that right click and select New and then select Text Document and rename it to 'ssh'. It is important to remove the .txt extension from the file.
    • Install Notepad ++
    • You now need to set a static IP address for your Pi. I recommend using this instead of a dynamic IP address because you might be in a situation where you do not have control over your router.
    • In your SD card directory right click on the file cmdline.txt and edit it using Notepad++
    • Edit the file to sure the contents of your file look like this
    dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=2f542d6a-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles ip=192.168.1.200::192.168.1.1:255.255.255.0:rpi:eth0:off

    Or alternatively download and simply replace the cmdline.txt and ssh files in the SD card directory

    Download cmdline.txt
    Download ssh

    In order to recognize this IP address of Pi we need to edit some network settings in our computer.
    • Right click on your Wifi/Ethernet icon on your taskbar and select 'Open Network and Sharing Settings'
    • Now select 'Change adapter setings'
    • Double click on Ethernet and select Properties and from the list double click on Internet Protocol Version 4(TCP/IPv4).
    • From first two options select 'Use the following IP address' and input the following values
    IP address: 192.168.1.201
    Subnet mask: 255.255.255.0
    Default gateway: 192.168.1.1
    • Now select 'Use the following DNS server addresses' and leave the two address rows blank.
    • Click OK to save the settings
      Lets get started with the Raspberry Pi
      • Install Putty
      • Insert your SD card in your Pi and plug the ethernet cable in your Pi and computer
      • Plug in the power supply and switch it on
      • Now open Putty
      • In Hostname enter 192.168.1.200 and select SSH under it.
      • Next, in the left pane, expand SSH under Connection and select X11
      • Check the box that says 'Enable X11 forwarding' and in X display location enter 'localhost:0' (without the quotes)
      • Click on Open
      • Now you should see a login prompt. Enter pi and hit enter
      • In the password field enter raspberry (You will not be able to see the entered password) and hit enter
        Voila! You have successfully logged into your Raspberry Pi using SSH

        I would now recommend you to change the password for Raspbian. You can do this by typing the following command in putty

        sudo raspi-config

        Now select the first option and change your password.

        You can also save the current configuration in Putty so that you do not have to make all the settings for every time you log into your Pi. You can do this by making all the settings in Putty and then using the Save option in the Session tab.

        Feel free to post any comments or suggestions!

        Comments

        Popular posts from this blog

        Lighting A LED Using Raspberry Pi

        Lights? Cool ha? Lights are an easy way to express indications for any process, they are like little alerts or notifications. Today, let's learn how to set up a LED with a Raspberry Pi. You should already know how to log in via SSH and use Filezilla. If you don't know how to, then follow the links below: SSH - click here Filezilla - click here To see the practical demonstration, watch the video below. Things you'll need: Raspberry Pi Power source for Pi A LED Resistor (330  Ω ) Breadboard Male to female jumper cables Assemble your circuit as shown below: Note: Make sure you connect the positive end of the LED to GPIO 21 and the negative end to Ground PIN Now turn on your Raspberry Pi and copy the LED.py file to /home/pi/ using Filezilla Download LED.py here Now open terminal and type the following: sudo python LED.py Your LED should now blink 4 times with a delay of 2 seconds. To exit the program press: Ctrl+C

        Raspberry Pi Music Player

        Love Music? Or are too nerdy to make your own gadgets! (That was one of mine reasons. Duh!) Well, this is the Raspberry Pi Music Player. Watch the video below to find out what it is like Features: Control over bluetooth (smartphone) Commands can be given via voice (smartphone) Play Next Stop Increase Volume Decrease Volume First Song Date Time Shut Down LCD On LCD Off LCD Brightness Control Additional Info: I also installed Rune Audio on my other SD Card so that I could use it over my WiFi. But yes, that requires switching cards. But that makes it portable with a web interface. Currently facing problems with: Running without Ethernet plugged in on boot (worked perfectly fine with previous versions of Raspbian). Wanting to do this to make it portable. Repeat Functionality Shuffle Playing songs from USB And a few more bugs Write to me at sparkthatplug@gmail.com if you think you can help me with those problems. Innovative ideas are always