2

I'm trying to use SSH for the Raspberry Pi so I can control it from my PC.

I followed the youtube video Raspberry Pi - How to SSH - Remote view your Pi... but the result was "connection refused".

My Raspberry Pi is using a Wi-Fi dongle connected to the router which has a ping of inet addr: 192.168.1.2, Bcast:192.168.1.255. I'm using X11 as a forwarder, which was used in the link.

So what is the mistake have I made? Do I need to download something for my PC, to use SSH, or is PuTTy enough?

Greenonline
  • 2,740
  • 4
  • 23
  • 36
Jane Alvord
  • 61
  • 2
  • 3
  • 4
  • 1
    Depends on the distribution you use - you most likely need to enable ssh explicitly in the distribution configuration tool. – Thorbjørn Ravn Andersen Jan 07 '14 at 01:16
  • Umm.. What do you mean by distribution? I enabled ssh in raspberry already.Is that what you mean? – Jane Alvord Jan 07 '14 at 02:46
  • Distribution means the variety of OS that you are using - i.e. Raspian Wheezy, Ubuntu, Fedora, etc. – Greenonline Feb 08 '16 at 06:54
  • Is the IP settings - Configured Static / Dynamic --- Windows machine? If it is dynamic - it will have IP 169... If it is static - it will have IP 192... Could you please check that? Disable the internet connection in your machine/host/computer. ifconfig /all - To get the machine/host/computer ip. What is there in cmdline.txt file, does your ip match? Just a note(need not be necessary, but I am following this): Always add from the machine/host/computer ip + 3 to your raspberrypi board. Try disabling and enabling the interface card of your machine/host/computer. – techEmbedded Feb 08 '16 at 09:20

2 Answers2

2

Putty is more than enough to SSH in. Firstly make sure you have installed an SSH server on your raspberry PI such as OpenSSH. Next make sure you can ping your raspberry PI's IP address using a ping command, in your case ping 192.168.1.2. Press ctrl+c at anytime to stop pinging. If you are unable to ping your raspberry PI, then you know there is a problem with your raspberry PI even connecting to your local network.

If it is a success, connect to your PI via Putty. To connect to it via Putty, open putty, enter the IP of your raspberry PI under Host Name (or IP address) and 22 for the port. You should then be connected to the raspberry PI's terminal and be able to login.

If you get a connection refused (I believe this is where your at) the raspberry PI is not accepting connections on port 22. This is most likely due to an incorrectly setup SSH server. You should look into another tutorial for your specific distribution. Distributions are like flavors of Linux, you're most likely using one of these http://www.raspberrypi.org/downloads. Most likely Raspbian. A good tutorial for Rasbian is https://www.modmypi.com/blog/remotely-accessing-the-raspberry-pi-via-ssh-console-mode.

Fallen
  • 121
  • 1
  • Your answer was easy and very clear to understand but I still have the same problem which is connection refused. My raspberry pi was coincidentally using raspbian and followed the link you gave. I've set up the static address,able to ping my gateway.everything was going smoothly till I connect the raspberry pi with putty > connection refused. – Jane Alvord Jan 07 '14 at 07:58
  • I did some searching in "google" maybe that I'm using an ip address similar to one of the computer in my lab eventhough i don't think it is the reason for my putty to show connection refused. – Jane Alvord Jan 08 '14 at 01:36
  • After trying to solve this problem ,my raspberry pi cant read my /etc/network/interfaces – Jane Alvord Jan 10 '14 at 06:43
  • If your Pi could connect to the internet, changing to a static IP is not going to help, it only confuses the issue. Post the result of ifconfig. – Milliways Jan 14 '14 at 03:30
  • I'm using a wifi dongle so i don't know whether the settings below is ok> wlan0 Link encap:Ethernet Hwaddr 00:0f:13:38:26:6d inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0 Rx packets:26 errors Tx packets:15 errors.I reformatted the sd card so its running fine already its just that my putty connection refused.even my pinggateway is alright as it could ping 10 times ping "192.168.1.1 -c10" – Jane Alvord Jan 15 '14 at 01:50
  • I don't know if your using DHCP and just restarted the pi, but try using 192.168.1.5 to connect through putty. Another thing you might want to look into is iptables. I'm not sure if Raspbian has iptables but it's worth checking into. It's kind of like a firewall and may be blocking your connection. More info: http://raspberrypi.stackexchange.com/questions/5334/how-can-i-disable-raspbmcs-firewall-via-ssh – Fallen Jan 15 '14 at 22:50
-2

if the ping fails, check your router settings => host isolation / or Wifi/ethernet isolation must be disabled.

twooBeers
  • 23
  • 3