puTTY


18 posts
by liamprice » Sun Jan 06, 2013 4:40 pm
How do i start using putty on my windows machine? I have already downloaded it on my pi :D
liam price
Posts: 37
Joined: Sat Dec 29, 2012 7:56 pm
Location: Somewhere
by Digital Larry » Sun Jan 06, 2013 4:45 pm
Just run putty on the Windows machine.

Under Host name (or IP address) enter the IP address of your Pi. It is on the network, right? Make sure "SSH" is selected and then click the "Open" button. Then you should get a login/password prompt.

If your Pi always comes up on the same IP address then you can "Save" this setting for easier access in the future.

I use PuTTY ALL THE TIME because it's way easier to do things on my laptop and then transfer them over to the Pi to run and test.
Posts: 62
Joined: Tue Jul 24, 2012 9:10 pm
Location: Silicon Valley, CA
by Mobius » Sun Jan 06, 2013 7:59 pm
Not sure why you would need puTTY on your Pi. If you are running the Raspbian Wheezy image then all you need to do on the Pi is to run raspi-config and enable SSH. On your Windows machine just run puTTY and select SSH then enter the correct IP and port number of your Pi. The default SSH port is 22.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by liamprice » Sun Jan 06, 2013 8:25 pm
How do i find the ip of the pi?
liam price
Posts: 37
Joined: Sat Dec 29, 2012 7:56 pm
Location: Somewhere
by kalehrl » Sun Jan 06, 2013 8:27 pm
type:
Code: Select all
ifconfig

in console and find a line which looks like this:
Code: Select all
inet addr:192.168.1.6

192.168.1.6 is your ip address.
And you don't need putty on your Pi if you just want to connect to it from Windows.
You only need ssh enabled which is default.
Posts: 342
Joined: Tue Jul 24, 2012 10:49 am
by liamprice » Thu Jan 10, 2013 6:44 pm
Is there a way of doing a similar thing on a windows to a windows machine?
liam price
Posts: 37
Joined: Sat Dec 29, 2012 7:56 pm
Location: Somewhere
by MartinV » Thu Jan 10, 2013 7:27 pm
Is it possible to run Putty over the internet so I can access my Pi from any computer ?
I would be very grateful if someone would give me a tutorial on that.
Posts: 3
Joined: Tue Jan 08, 2013 8:39 pm
by RobHenry » Fri Jan 11, 2013 5:09 pm
1. Set your router to give the Pi a static IP address (or set it as static on the Pi, but the former is probably easier)

2. Set up port forwarding on your router to forward port 22 to the static ip address of the Pi

3. Establish the external ip address of your router

4. Ssh to the internet address of the router from outside your local network

If your isp uses dynamic ip addresses then it will only work for as long as your router retains the same ip address.
Posts: 218
Joined: Fri Sep 21, 2012 9:04 pm
Location: Edinburgh
by Mobius » Fri Jan 11, 2013 6:49 pm
RobHenry wrote:1. Set your router to give the Pi a static IP address (or set it as static on the Pi, but the former is probably easier)

2. Set up port forwarding on your router to forward port 22 to the static ip address of the Pi

3. Establish the external ip address of your router

4. Ssh to the internet address of the router from outside your local network

If your isp uses dynamic ip addresses then it will only work for as long as your router retains the same ip address.


But doesn't that just log you into your router? How do you get from the router external IP address to the Pi? I'm not outside of my own network at the moment, but using my router's external address (not the internel network gateway address) just puts me at the router login screen.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by RobHenry » Fri Jan 11, 2013 8:36 pm
by Mobius » Fri Jan 11, 2013 7:49 pm

But doesn't that just log you into your router? How do you get from the router external IP address to the Pi? I'm not outside of my own network at the moment, but using my router's external address (not the internel network gateway address) just puts me at the router login screen.


Most home networks have one external ip address - that of the router. When an incoming connection arrives the router needs to know which machine on the network should receive it, since they all have the same internet address. This is achieved by assigning an incoming target port to a particular ip address on the internal network - ssh uses port 22 so the router should be set up to forward all external requests targeting port 22 to the raspberry pi. This means that you cannot have two devices available for ssh on the same home network, unless one of them is set up to receive ssh through a different port (and the client connection request must reflect this).

It sounds as though the address you have used to connect to your router (probably 192.168.1.1 or similar) is not the router's external ip address, but is its address within your home network.

Let me know if that doesn't make sense and I will write an example with default ip addresses.
Posts: 218
Joined: Fri Sep 21, 2012 9:04 pm
Location: Edinburgh
by Jim JKla » Fri Jan 11, 2013 8:44 pm
Here's another walkthrough http://elinux.org/RPi_A_Method_for_ssh_blind_login it includes a description of Putty
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 1935
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK
by RobHenry » Fri Jan 11, 2013 9:06 pm
by Jim JKla » Fri Jan 11, 2013 9:44 pm
Here's another walkthrough http://elinux.org/RPi_A_Method_for_ssh_blind_login it includes a description of Putty


I had gone off topic in response to:

by MartinV » Thu Jan 10, 2013 8:27 pm
Is it possible to run Putty over the internet so I can access my Pi from any computer ?
I would be very grateful if someone would give me a tutorial on that.


Anyone who's reading this and doesn't know, be aware that the wiki link above relates to putty on an internal network and not the tutorial that MartinV requested (i.e. over the internet).
Posts: 218
Joined: Fri Sep 21, 2012 9:04 pm
Location: Edinburgh
by Jim JKla » Fri Jan 11, 2013 9:09 pm
No problem. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 1935
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK
by Mobius » Sat Jan 12, 2013 12:26 am
RobHenry wrote:
by Mobius » Fri Jan 11, 2013 7:49 pm

But doesn't that just log you into your router? How do you get from the router external IP address to the Pi? I'm not outside of my own network at the moment, but using my router's external address (not the internel network gateway address) just puts me at the router login screen.


Most home networks have one external ip address - that of the router. When an incoming connection arrives the router needs to know which machine on the network should receive it, since they all have the same internet address. This is achieved by assigning an incoming target port to a particular ip address on the internal network - ssh uses port 22 so the router should be set up to forward all external requests targeting port 22 to the raspberry pi. This means that you cannot have two devices available for ssh on the same home network, unless one of them is set up to receive ssh through a different port (and the client connection request must reflect this).

It sounds as though the address you have used to connect to your router (probably 192.168.1.1 or similar) is not the router's external ip address, but is its address within your home network.

Let me know if that doesn't make sense and I will write an example with default ip addresses.


I was able to access the Pi using puTTY (but not directly via a web browser) but I had to go into my router and disable one of the Pi interfaces because both the ethernet and the wireless use the same port. They have different IP addresses so I can use puTTY on my local network to start up interfaces on both the ethernet and the wireless at the same time. Is it possible to set the Pi to use more than one port for SSH?
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by Mobius » Sat Jan 12, 2013 1:23 am
Ok, never mind. I discovered that you can set up the sshd_config file for multiple ports. Now I've got internal and external access.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by milhouse » Sat Jan 12, 2013 1:54 am
Just be aware that allowing internet access to Raspbian is not a very good idea without taking some basic security precautions, such as disabling password login to the pi account (use public/private keys instead). At the very, very least, you must change the default pi password to something much stronger than "raspberry". I would also investigate tools such as sshblack (useful installation here) that automatically blacklist IP addresses that fail to login via ssh (thus foiling any potential brute force attack).

If you will only be connecting to your home network from a static IP address, I would strongly advise configuring your router (probably on the same settings page where you setup the Port Forward rule) so that it only accepts inbound ssh connections from specific, known, IP addresses that you specify.

By default, Raspbian is extremely insecure, which is tolerable on an isolated, home LAN but not so much when visible to and accessible by the entire internet...
Posts: 551
Joined: Mon Jan 16, 2012 12:59 pm
by milhouse » Sat Jan 12, 2013 2:39 am
This thread prompted me to review the number of "attacks" my Netgear router on the UK Be/O2 network (static IP) registers each day. Each "attack" is logged over syslog to my Raspbian Pi, and totting up the number of entries...

Code: Select all
Nov 29: 60
Nov 30: 360
Dec  1: 249
Dec  2: 197
Dec  3: 342
Dec  4: 351
Dec  5: 632
Dec  6: 408
Dec  7: 307
Dec  8: 304
Dec  9: 215
Dec 10: 495
Dec 11: 438
Dec 12: 412
Dec 13: 373
Dec 14: 489
Dec 15: 653
Dec 16: 479
Dec 17: 433
Dec 18: 596
Dec 19: 544
Dec 20: 427
Dec 21: 304
Dec 22: 450
Dec 23: 232
Dec 24: 195
Dec 25: 145
Dec 26: 147
Dec 27: 247
Dec 28: 140
Dec 29: 232
Dec 30: 243
Dec 31: 250
Jan  1: 169
Jan  2: 153
Jan  3: 139
Jan  4: 320
Jan  5: 706
Jan  6: 930
Jan  7: 542
Jan  8: 800
Jan  9: 670
Jan 10: 228
Jan 11: 374
Jan 12: 27


reveals an average of 380 attacks per day (January looks like being a busy month), and that's just the activity perceived as "Dos Attacks", so there may be even more that simply aren't being logged. I'm sure most of these "attacks" are not actual DoS attempts, but these IP addresses that are being logged shouldn't be connecting to me at all so they're up to something. Just sayin', before anyone puts an unsecured device (Raspbian or otherwise) on the internet...
Posts: 551
Joined: Mon Jan 16, 2012 12:59 pm
by Mobius » Sat Jan 12, 2013 3:07 pm
milhouse wrote:Just be aware that allowing internet access to Raspbian is not a very good idea without taking some basic security precautions, such as disabling password login to the pi account (use public/private keys instead). At the very, very least, you must change the default pi password to something much stronger than "raspberry". I would also investigate tools such as sshblack (useful installation here) that automatically blacklist IP addresses that fail to login via ssh (thus foiling any potential brute force attack).

If you will only be connecting to your home network from a static IP address, I would strongly advise configuring your router (probably on the same settings page where you setup the Port Forward rule) so that it only accepts inbound ssh connections from specific, known, IP addresses that you specify.

By default, Raspbian is extremely insecure, which is tolerable on an isolated, home LAN but not so much when visible to and accessible by the entire internet...


Thanks for the info. I am using a different username and password and the default Pi user no longer exists. I suppose one way around the issue would be to connect to a Dynamic DNS service like I have for my security cameras. At the moment I don't have any particular need for external access to the Pi but if I set up some sort of control function using the GPIO then I'd like to be able to control it when I'm away from home.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA