October 28, 2009

How to Install Putty on OS X

<div class=\"postavatar\">how-to-install-putty-on-os-x</div>

Speaking of shells, do you need a free shell account?
Then sign up at Devio.us!
You’ll get unrestricted shell access via SSH and access to all standard software – compilers, IRC clients, mail clients, screen, etc. Check out the details at http://devio.us/services

Some people are very used to Putty and they miss it when they are on a Mac. Is there a version for OS X? No, so this post is for those people. This really isn’t an install per se, it’s actually called a port. Putty doesn’t work “naturally” on OS X, so you need to use MacPorts to ‘port’ it to your Mac. When utilizing MacPorts, you can find that there are thousands of programs you can run on your Mac that normally wouldn’t be available. The interfaces may feel or act a bit differently, but it’s better than not having them at all.

Here are the steps to get it geared up:

1) Install MacPorts – Download/instructions for MacPorts (Be sure to pick the correct file for your OS X version.)

2) Open the saved .dmg file to install MacPorts.

3) After installation of MacPorts is complete, there’s one more item to check. Make sure you have XCode installed on your computer. If you are running OS X 10.6, you should download and run XCode 3.2. You will have to be a member (which is free) of Apple Developer Connection to download the file. The reason you need developer tools is because you are actually compiling source code in order to get this working, as a developer does.

4. After installing XCode, open up Terminal and paste this command:
sudo port -v selfupdate
This updates your install of MacPorts. You should see the update take place. If you don’t, leave a comment here so we can help you out with the error. But everything should work fine if the steps above have been followed exactly.

5. All you have to do next is paste this command:
sudo port install putty
This should take a few minutes and work without a hitch.

6. Now to start using it, type this into Terminal and Putty will then pop right up into an X11 window:
putty

7. To put a shortcut on the Desktop, run an additional command in the terminal:
cp /opt/local/bin/putty ~/Desktop/PuTTY

Additonal Install/Migration Instructions

If you have installed MacPorts prior to Snow Leopard, you have to run a few fixes to get Putty to work again properly.

1. Open Terminal
2. Paste:
sudo port uninstall glib1; sudo port uninstall gtk1; sudo port install putty
3. Once done, all the necessary libraries should be updated and you should have a new Putty up and running.

Note:
When I first started to write this article, I was going to use Fink, however, it appears they dropped the package. So I opted for MacPorts which is the most recently updated and compatible. It all works – for now.

What this means:
Eventually, everyone who is accustomed to Putty will need to change directions indefinitely, so please take a look at Daniel’s post on Terminal in OS X. Until then, keep hacking and compiling if you really need to.


Share

About the author, Kayla

First a geek, now a photographer too. Check out my site at kaylaselans.com

30 Comments Post a comment
  1. Justin Zollars
    Oct 28 2009

    Thank you for your help! Appreciated post.

  2. carl
    Nov 1 2009

    I have OS X Tiger. I installed MacPorts. Then, I isnstalled X-Code and WebObjects.mpkg. I wrote the X- Code update comment on Terminal. It gave an error: command not found. I have a router and Firewall was on. Could you please help me how to install Putty?

    Thanks in advance

    Carl

  3. Daniel
    Nov 1 2009

    Make sure you install MacPorts properly prior to running the ‘sudo port -v selfupdate’. It’s saying ‘command not found’, because ‘port’ (ie. macports) cannot be found.

    Thanks.

  4. Nov 1 2009

    Your network equipment or settings should not be preventing a successful install of MacPorts. Since you have Tiger, did you install XCode 2.5?

  5. Guido
    Dec 30 2009

    Hi Daniel & Kayla – Thanks for publishing this information, you are a great resource. Once I had PuTTy installed, it works fine. The only issue I have is getting a serial console session via a USB-Serial adapter. The adapter is installed and accessible using the Apple provided pl2303 driver. I can open a connection pointing to the /dev/tty.PL2303-00001004 serial line, and I can see physical evidence that my keystrokes are passing through (via the LED on the USB device), but the terminal screen remains blank. I’ve tried changing the normal serial options (local echo, etc) with no result. Any ideas?

  6. Kathleen
    Jan 24 2010

    Computing dependencies for puttyError: Unable to execute port: can’t read “build.cmd”: Failed to locate ‘make’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it?
    Before reporting a bug, first run the command again with the -d flag to get complete output.
    I did not know how to add -d flag. Did try adding it like this: sudo port install putty -d
    Got the above message 2x. Thanks for any help

  7. Jan 24 2010

    @Guido: try messing with the baud rate settings – typically most devices will use 9600 bps, 8N1 (bps, parity, bits). If you have a manual for the device that you’re trying to console, it most likely has a section which describes how to access it via serial. Another possibility – the device might require you to use a serial or a null modem cable – both look identical, however are wired differently. Finally, just to be sure – you can also try to access the serial device by opening Terminal and typing the following:

    ‘screen /dev/tty.PL2303-00001004 9600′

    Again, try to mess with the baud rate depending on what the device takes.

  8. Jan 24 2010

    @Kathleen,

    It wasn’t able to locate the ‘make’ binary. ‘make’ should ship with all the compilers etc. that are provided with XCode.

    Are you sure you have XCode fully installed?

    Thanks,

  9. Kathleen
    Jan 24 2010

    I was able to download xCode 2.5 and installed then went back and followed these instructions. Everything seemed to go fine. But when I type in putty per step 6 I get this message: kathleens-computer:~ kathleenhallren$ putty

    Gtk-WARNING **: cannot open display: :0
    Thanks for any assistance. I seem to be making progress.

  10. Kathleen
    Jan 25 2010

    I was able to solve the problem. I did not have x11 installed for some reason. Loaded it from Xcode Tools and downloaded upgrade from apple. Now I am up and running PuTTY. Thank you, the notes and hints on here led me through the process.

  11. Jan 26 2010

    Instructions work AS Advertised for Snow Leopard :)

    I did have minor issue with needing to update XCode. But, after that, I am as happy as a WinDoZe user could ever be… ease for all of my tunneled connections.

    Thx for the post !!!

    Martin

  12. Kathleen
    Jan 30 2010

    In my system settings I have selected the option for the F keys to function as F1, F2 etc. They work up to F8. I have had this problem with other VPN and emulation programs. Is there a key combination or work around for this. Thank you.

  13. Jan 30 2010

    Hi Kathleen! To use the actual function keys, just hold down the ‘function’ key (“FN”, bottom left of your keyboard) and press whichever F[1-12] key you need (ie. FN+F4 etc.).

  14. Christos
    Dec 24 2010

    Hello I have mac os 10.6.5 and XCode 3.2.4 i installed MacPorts and then i did
    >sudo port -v selfupdate
    as a super user and everything was fine but when i did
    >sudo port install putty
    as a super user after long time i got this error

    Error: The following dependencies were not installed: gtk1 xorg-libXext xorg-libX11 xorg-libxcb python26 db46 gdbm openssl zlib readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXt xorg-libsm xorg-libice

    any advice?

  15. Paul
    Jun 17 2011

    I already finished the installation, everything looks good but i need to wait few days after test that, but im pretty sure this can work without problem.

  16. Rana
    Oct 24 2011

    I enter the first command to update in terminal but required password i tried to write but I couldnt write anything for the password.

  17. reverseproxy
    Jan 13 2012

    I’m confused. Do you have to download the exe from http://www.putty.org first?

  18. snehith
    Jan 31 2012

    sent 36 bytes received 77 bytes 25.11 bytes/sec
    total size is 512 speedup is 4.53
    Creating port index in /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports
    Hi,
    Can you please help me out why i am getting this error while update the port i used the cammand which is mentioned in the website
    i.e :sudo port -v selfupdate
    Total number of ports parsed: 0
    Ports successfully parsed: 0
    Ports failed: 0
    Up-to-date ports skipped: 13523

    —> MacPorts base is already the latest version

    The ports tree has been updated. To upgrade your installed ports, you should run
    port upgrade outdated

    Thanks,
    Snehith

  19. Robert Hadstate
    Feb 26 2012

    Running OS X 10.3. Trying to install putty. have installed mac ports and xcode 4,

    This is message I get.
    Last login: Sun Feb 26 15:10:12 on ttys000
    Roberts-MacBook-Air:~ rhadstate$ sudo port install putty
    Password:
    Warning: xcodebuild exists but failed to execute
    Warning: Xcode does not appear to be installed; most ports will likely fail to build.
    —> Computing dependencies for puttyError: Unable to execute port: can’t read “build.cmd”: Failed to locate ‘make’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it?
    To report a bug, see
    Roberts-MacBook-Air:~ rhadstate$

    If you can help I would appreciate.

    Thanks.

  20. kenan
    Feb 29 2012

    Hi Kayla,

    It doesn’t work.

    sudo port install putty
    Warning: xcodebuild exists but failed to execute
    Warning: Xcode appears to be installed but xcodebuild is unusable; some ports will likely fail to build.
    Warning: You may need to run `sudo xcode-select -switch /Applications/Xcode.app`
    Warning: The Command Line Tools for Xcode don’t appear to be installed; most ports will likely fail to build.
    Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information.
    —> Computing dependencies for puttyError: Unable to execute port: can’t read “build.cmd”: Failed to locate ‘make’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it?
    To report a bug, see

  21. kenan
    Feb 29 2012

    Hi Kayla,

    Almost forgot, I’m OSX Lion at the moment.

  22. ch
    Mar 27 2012

    how do i go to the terminal?

  23. guan
    May 11 2012

    Hi,

    having this error

    $ sudo port install putty
    Warning: The Command Line Tools for Xcode don’t appear to be installed; most ports will likely fail to build.
    Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information.
    —> Computing dependencies for puttyError: Unable to execute port: can’t read “build.cmd”: Failed to locate ‘make’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it?
    To report a bug, see

    running on macbook air – lion 10.7.4

    thank and regard

  24. Actisys
    May 20 2012

    If you’re getting error while installing please be remember to open your Xcode and download all require library files. As I know the new Xcode doesn’t come with it.

    After install everything, do a reboot then follow above method to install your putty.

    p/s: Tested OK! :) Cheers

  25. Sri Satish
    May 30 2012

    Like piece of Cake. Many many Thanks….

Trackbacks & Pingbacks

  1. PuTTY for OS X? No thanks.
  2. Tweets that mention How to Install Putty on OS X using MacPorts -- Topsy.com
  3. Apple OS X Updates Safari Security Bug
  4. Irssi is the best free IRC client for OS X
  5. Dluuuuuga instalacja puty :/

Leave a Comment

Note: Make sure you enter the required information where indicated. HTML is allowed. Your email address is Required but, will never be published.

Required
Required, but not shared

Get notified Subscribe to comments