Installing and Using Putty on Mac (OS X)

Installing and using Putty on a Mac or OS X is extremely easy. The following steps have been tested on Mountain Lion (OS X 10.8.2) but should work on other versions as well. For references, I used this and this. Also, if you tried installing Putty before finding this guide and got errors such as:

Error: Gtk-WARNING **: cannot open display, or
Error: port selfupdate failed,

then please refer to points 10, 11, and 12 for solutions below.

 

1. Download Xcode

This can be found at the Apple Developer Connection site, on your Mac OS X installation CDs/DVD, or in the Mac App Store.

 

2. Install Command Line Tools for Xcode

Under Xcode:

Preferences -> Downloads -> Components -> Install 'Command Line Tools'

 

3. Accept the Xcode EULA

Either launch Xcode or run:

xcodebuild -license

 

4. Download and Install MacPorts

https://distfiles.macports.org/MacPorts/MacPorts-2.1.2-10.8-MountainLion.pkg

 

5. Update MacPorts

Note: Make sure Xcode is fully installed.
sudo port -v selfupdate

 

6. Install Putty

sudo port install putty

 

7. Download and Install X11 (XQuartz)

http://xquartz.macosforge.org/landing/

 

8. Run Putty

Type ‘putty’ into Terminal:

putty
This should open Putty in an X11 window.

 

9. Desktop Shortcut for Putty

cp /opt/local/bin/putty ~/Desktop/PuTTY

 

10. Note 1

Error: Gtk-WARNING **: cannot open display:

If you get the above warning, please make sure you are using XQuartz as your X11 Emulator. Then go ahead and either restart Mac or simply log out and log back in. That should resolve the issue.

 

11. Note 2

Error: port selfupdate failed: Error installing new MacPorts base: shell command failed

If you get the above warning, please make sure you gave followed step 2 above. That would be:

Preferences -> Downloads -> Components -> Install 'Command Line Tools'

 

12. Note 3

If your error involves Xcode 4.3 and installing Putty using
sudo port install putty

This error occurs because the command line tools are installed in a different folder. You can fix the problem by copying them to the normal path:

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

So these steps should allow you to install and use Putty on Mac and specifically, OS X 10.8. As always, if this was helpful to you, then please do not forget to leave a comment, or two. :)

  • Pick

    Is there ability to show program menu in running session ? I see only XQuartz menu when i focus Putty

    • Pick

      oh i found its “command+right click” on terminal area

  • Alan Oehler

    After installing X11, I try running putty and I just get the message

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

    Am I missing something? (The XQuartz installation finished with some message about needing to log out and back in to set X11 as the default. I closed the terminal window and then opened it again… maybe I have to just log out of my current Mac session and back in?)

    • saxenap

      Hello Alan,

      I know this is coming very late, but you can simply either restart Mac or logout and then log back in to resolve the issue.

  • DZ

    This is great.. QQ what is the serial line to connect to if I am trying to use a prolific USB to serial cable?

  • dz

    Never mind found it

    ls /dev/tty.* shows your tty

  • maya

    Thank you so much for giving the detailed procedure to install Putty. I just installed it successfully on oX X 107.5

  • maya

    installed on OS X 10.7.5

    • Abhilasha

      After Step 6 , I am getting below error msg :

      —> Computing dependencies for putty

      —> Dependencies to be installed: gtk2 atk gobject-introspection cairo xorg-libXext xorg-libX11 xorg-libxcb python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 xz xorg-xextproto xorg-xcb-util xrender xorg-renderproto gdk-pixbuf2 jasper jpeg tiff hicolor-icon-theme pango Xft2 harfbuzz graphite2 shared-mime-info xorg-libXcomposite xorg-compositeproto xorg-libXfixes xorg-fixesproto xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-inputproto xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto

      —> Verifying checksum(s) for python27

      Error: org.macports.checksum for port python27 returned: Python-2.7.5.tar.xz does not exist in /opt/local/var/macports/distfiles/python27

      Error: Failed to install python27

      Please see the log file for port python27 for details:

      /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_python27/python27/main.log

      Error: The following dependencies were not installed: gtk2 atk gobject-introspection cairo xorg-libXext xorg-libX11 xorg-libxcb python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 xz xorg-xextproto xorg-xcb-util xrender xorg-renderproto gdk-pixbuf2 jasper jpeg tiff hicolor-icon-theme pango Xft2 harfbuzz graphite2 shared-mime-info xorg-libXcomposite xorg-compositeproto 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

      How to fix this .

  • Lou

    Very cool! One less dependency on PC – thanks

  • mattsyd

    Thanks. Great tutorial, now I’ve got just to figure out how to setup this Cisco 800 series modem/router

  • Dave Korns

    Hi … I got a new system with 10.8.3 a few weeks ago and one of the first things I did was this installation process. Worked like a charm. I let a few days go by before to returning to try and use putty again later and suddenly getting this error:

    hostname:Console Logs davekorns$ ./putty
    dyld: Library not loaded: /opt/local/lib/libX11.6.dylib
    Referenced from: /Users/davekorns/Desktop/Console Logs/./putty
    Reason: image not found

    Trace/BPT trap: 5

    So it looked like something was messed up with the /opt/local/lib path. When I started looking around at my system I found there was no /opt/local slash anything. No /opt at root top-level. From the name of the file involved I assume that when I installed XQuartz it laid some files down on my Mac in /opt/local/lib. But what happened? Where did it go? Was there even a /opt on my Mac before I started this process (I’m not sure). I have this sick feeling that OS X (10.8.x, or .3 for me) later decided I should not be messing in /opt and hide it from me. I notice this version of OS X hide the user’s Library directory from. I found articles on how to un-hide that but that was different. I could not see my user/Library in the GUI, but I could see it in the CLI shell with a ‘ls -la’ command.

    This is different. Where did my putty go? Anyone else seen anything like this?

    Dave

  • Abhilasha

    cp: Applications/Xcode.app/Contents/Developer/usr/bin/*: No such file or directory

    Why we get this ?

  • Andre

    Are you allowed to provide the executable? I’d much prefer that to downloading and ocmpiling code…

  • Woodstock

    Thanks so much for this info! Works well.

  • Matthew

    Amazing Thank you!

  • RK

    Thank you so much for putting up the process. It works.

  • Mavis

    It works! Thanks!!!

  • Pretorianeca

    thenks it was a great explain