October 28, 2009

How to Install Putty on OS X

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 Selans

First a geek, now a photographer too. What's next? Check out other projects I'm involved in, such as Devio.us and AskMoms.com. Then there's also Twitter @kayla if you'd like to ask me a question. These days, it's hard to see real questions from all of the spam to my username, so it might be better to leave a comment here on a post. :)

52 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….

  26. Jun 13 2012

    Thanks, very helpful:o)

    Just a couple of additional points required to make this work…

    1. Current version of XCode is 4.3.3 (Free)
    2. Once this is installed you need to run it, then go to Preferences > Download and install Command Line Tools before Putty can be ported in.

    Cheers =OD

  27. Ravi
    Jun 13 2012

    I installed every bit but when I start putty on my mac osx lion. I t gives me following error:
    Please help

    (putty:76713): GdkPixbuf-WARNING **: Error loading XPM image loader: Image type ‘xpm’ is not supported

    (putty:76713): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)’ failed

    (putty:76713): GdkPixbuf-WARNING **: Error loading XPM image loader:
    Image type ‘xpm’ is not supported

    (putty:76713): GdkPixbuf-WARNING **: Error loading XPM image loader: Image type ‘xpm’ is not supported

    (putty:76713): GdkPixbuf-WARNING **: Error loading XPM image loader: Image type ‘xpm’ is not supported

    (putty:76713): Gdk-CRITICAL **: void gdk_window_set_icon_list(GdkWindow *, GList *): assertion `GDK_IS_PIXBUF (pixbuf)’ failed

  28. Dante' Perkins
    Jun 26 2012

    How to fix???

    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?

  29. Shayne
    Jun 28 2012

    I tried to install putty, but got this error:

    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?

    I did use the -d flag that someone suggested. Any advice?

  30. Evgeny
    Jul 30 2012

    Hallo!
    I have Mac OS X 10.7.4. I installed MacPorts-2.1.2-10.7-Lion and Xcode-4.3.2.
    And now I have trouble like Rana:

    I enter “sudo port -v self update” to update in terminal but required password. I tried to write but I couldn’t write anything for the password.

    Thank you.

  31. Anubhav Singh
    Aug 1 2012

    Hey,

    This is what I get

    Anubhav-Singhs-iMac:~ itsmeanubhav$ sudo port -v selfupdate
    —> Updating MacPorts base sources using rsync
    rsync: failed to connect to rsync.macports.org: Operation timed out (60)
    rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
    Command failed: /usr/bin/rsync -rtzv –delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
    Exit code: 10
    Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed

    Can you please help ?

  32. Anubhav Singh
    Aug 1 2012

    Sorted the last error out !… Got this new one, just installed xcode, restarted my imac and tried to run these commands from the terminal

    Anubhav-Singhs-iMac:~ itsmeanubhav$ 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?

  33. Bear
    Aug 28 2012

    sudo: port: command not found

    That is exactly what it said. I installed the Mac Ports and I already have xcode.

  34. Sep 13 2012

    xCode 4.3 has the command line tool in a different folder, which will break the command ‘sudo port install putty’

    http://stackoverflow.com/questions/10346369/where-to-open-xcode-4-2-command-line-tools

    I fixed the problem copying the command line tool to the usual path

    sudo cp /Applications/Xcode.app/Contents/Developer/usr/bin/* /usr/bin/

  35. Khaled
    Oct 17 2012

    I got an error trying to do the update

    sudo port -v selfupdate

    Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command failed (see log for details)

  36. Khaled
    Oct 17 2012

    just thought to show the full output

    checking build system type… i386-apple-darwin12.2.0
    checking host system type… i386-apple-darwin12.2.0
    checking target system type… i386-apple-darwin12.2.0
    checking MacPorts version… 2.1.2
    checking for sw_vers… /usr/bin/sw_vers
    checking for defaults… /usr/bin/defaults
    checking for xcode-select… /usr/bin/xcode-select
    checking Mac OS X version… 10.8.2
    checking Xcode location… /Applications/Xcode.app/Contents/Developer
    checking Xcode version… 4.5.1
    checking for gcc… /usr/bin/cc
    checking whether the C compiler works… no
    configure: error: in `/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base’:
    configure: error: C compiler cannot create executables
    See `config.log’ for more details
    shell command “cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc ./configure –prefix=/opt/local –with-tclpackage=/Library/Tcl –with-install-user=root –with-install-group=admin –with-directory-mode=0755 –enable-readline && make && make install SELFUPDATING=1″ returned error 77
    Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command failed (see log for details)

  37. Khaled
    Oct 17 2012

    I just went to xcode and installed “Command Line Tools” and re-run the command ! works now

  38. navaneetha
    Nov 7 2012

    Hi ,
    I have MAC OSX Lion. I installed Macports, Xcode and also putty using cmd line. I typed ‘putty’ in cmd line but it is giving the following error.

    dyld: lazy symbol binding failed: Symbol not found: _cairo_xlib_surface_create
    Referenced from: /opt/local/lib/libgdk-x11-2.0.0.dylib
    Expected in: /opt/local/lib/libcairo.2.dylib

    dyld: Symbol not found: _cairo_xlib_surface_create
    Referenced from: /opt/local/lib/libgdk-x11-2.0.0.dylib
    Expected in: /opt/local/lib/libcairo.2.dylib

    Trace/BPT trap: 5

    Please help me to resolve this.

  39. Chris
    Nov 10 2012

    I face a problem.I did download all the things you said(Xcode,MacPort) and now I am running terminal and in the demand sudo port install putty it writes to meError:
    Error: No Xcode installation was found.
    Error: Please install Xcode and/or run xcode-select to specify its location.
    Error:
    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?
    I do have the latest version of iOS and I do have the latest version of Xcode

  40. Jenny
    Dec 6 2012

    Error: The following dependencies were not installed: gtk2 gdk-pixbuf2 hicolor-icon-theme pango Xft2 shared-mime-info xorg-libXcomposite xorg-compositeproto xorg-libXext xorg-xextproto xorg-libXfixes xorg-fixesproto xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-inputproto xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto
    To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
    Error: Processing of port putty failed

    I have the above errors, so I failed in installing it.
    Looking forward to your help.
    Thanks.
    Jenny

  41. CHARLES
    Dec 27 2012

    I have Mac OS X 10.7.4. I installed MacPorts-2.1.2-10.7-Lion and Xcode-4.3.2.

    i got the error below,
    Kindly help.

    CHARLESs-MacBook-Pro:~ charlesduru$ sudo port -v selfupdate

    updating MacPorts base sources using rsync
    rsync: getaddrinfo: rsync.macports.org 873: nodename nor servname provided, or not known
    rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
    Command failed: /usr/bin/rsync -rtzv –delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
    Exit code: 10
    Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed

  42. shahid
    Jan 4 2013

    PC-782:~ Shahid$ 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?

    any idea how to fix it?

  43. Thomas Holland
    Jan 24 2013

    I have installed putty sucessfully on Mountain Lion, but when I try to run it, I get the following error:
    (putty:13696): Gtk-WARNING **: cannot open display:

  44. Thomas Holland
    Jan 24 2013

    I answered my own question on the GTK error… I used XQuartz for my X11 emulator… logged back out and in then it worked.: http://xquartz.macosforge.org/landing/

  45. Hussain
    Jan 25 2013

    How can I install PuTTY on Mac OS 10.7.5? I always used Windows but recently bought a MacBook Air and don’t know how to do a lot of things but I am getting better with time…thanks in advance…

  46. John
    Feb 3 2013

    Got this far, all a seems fine until this point:

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

    Error displayed in Terminal:

    (putty:26948): Gtk-WARNING **: cannot open display:

    It then just displays the command prompt. Can’t find anything online that mentions this issue. I am running Mountain Lion 10.8.2

    Any ideas?

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 :/
  6. Installing and Using Putty on Mac (OS X) - Coding Steps

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