PuTTY for OS X? No thanks.

Many folks coming from the Windows world often ask where they can find the PuTTY client for OS X. While I do not wish to undermine the quality of the client (as it is, quite likely, the best for Windows), there is no such need for it on OS X. Why? This is simple – because all of the functionality that PuTTY offers, such as SSH, Telnet and Serial abilities come bundled with your OS X install. Since OS X is based on UNIX, it comes with a massive array of utilities that can be found across most different UNIX based OS’s and SSH and Telnet is no exception. (If you must install PuTTY on your computer, just read our other article How To Install PuTTY On OS X.)

Although you won’t find a pretty interface for performing your SSH/Telnet needs, it is nevertheless very simple to do (and without having to be a UNIX enthusiast). So how do you do it? Via the ‘Terminal‘ App, of course!

So let us begin.

In most cases, there are only 3 options that most people require from SSH and they are:

  1. Be able to specify an IP/Hostname
  2. Be able to specify an SSH/Telnet port
  3. Be able to specify a private SSH key

All of the above can be achieved very easily and quickly. First, open the ‘Applications‘ folder (cmd-shift-a from Finder or go to your Disk->Applications). Locate the ‘Terminal’ application and drag it over to your Dock. Once there, click the ‘Terminal’ icon and a prompt will pop up. From here, you are just a few keyboard strikes away from SSH’ing and telnet’ing your way around the internets.

To ‘ssh’ to a host, type ‘ssh [email protected]‘. This is rather self-explanatory – ‘ssh‘ is the command which invokes the ‘ssh’ program, ‘username‘ is the user you wish to connect as, and ‘hostname.com‘ is the host you wish to connect to. While there are multiple different syntaxes for ‘ssh’, this is likely the simplest one to remember.

Now that we’ve covered how to ‘ssh‘ to a host, lets specify a port. With no more than a couple of more keystrokes we can achieve just that. Same way as we specified the command before, this time around we just tack on a ‘-p 2222‘ to the end of the command. The ‘-p‘ is a command line option that takes an argument. So, the end result:

And finally, lets discuss how to use a private SSH key when connecting to a server via SSH. As you can probably already tell, this is achieved via a command line option as well. The option in question is ‘-i‘ and the argument that this option takes is the location of the private key. If you are unfamiliar with UNIX then locating the private key via the Terminal might be a bit confusing, but thankfully, the OS X terminal has a nice and simple solution to this.

Assuming your private key file is located on the Desktop, you can simply drag it over ‘on top’ of the Terminal window and the path to the key will be automatically added, saving you a whole lot of typing.

As you can see, you can specify multiple options in the same command!

There are many, many more other things you can accomplish with the ‘ssh’ client, however these subjects are beyond the scope of this quick intro.

And as a final note – the default color scheme for Terminal is rather ugly and many do not know that the Terminal can, in fact, be just as pretty as any other OS X app. To do so – go to Terminal->Preferences->Settings, select the ‘Pro‘ color scheme/theme and press the ‘Default‘ button. Quit the Terminal application and relaunch. You should now see a Terminal just like in the screenshots above 🙂

Good luck!

Share

42 Comments

  1. I don’t know – somebody even ported putty to Linux, so obviously there seems to be a demand for putty on Unixes or Unix-like platforms.

    The thing is, once you got used to putty’s weird copy & paste behaviour (via marking and right-clicking), you simply expect this functionality in telnet and ssh sessions. It’s actually quite handy and easy to use when you work a lot with Cisco routers.

    Furthermore, I can also relatively easy store session-specific profiles in putty.

    Since putty (and WinSCP) are some of my mostly used tools at work – where I use a Windows notebook – why should I switch to using something else when I’m in Linux, FreeBSD or OS X? Isn’t this one of the blessings of Open Source and multi-platform applications that I more or less can use my favorite apps no matter what system I’m using?

    So – yes, please, bring putty to OS X. 🙂

    Other than that, you wrote a very nice and helpful article. Thanks for that!

  2. Ed

    I’d love to see an example of how to use the serial capabilities.

    RE: “Furthermore, I can also relatively easy store session-specific profiles in putty.”

    It is extremely easy to add configurations for ssh as well. Simply edit ~/.ssh/config and add entries with your favorite text editor like so:

    Host myhost
    Hostname myhost.somewhere.net
    Port 2222 (optional)
    User me (optional, if different from your local account)
    Host myotherhost
    Hostname myotherhost.elsewhere.net

    Plus you can specify local / remote forwards, etc. Then you can simply do:

    ssh myhost

    And it’ll look it up in your config with whatever options you’ve specified. You can also have global options by using Host *

  3. Beat

    Yes! I know JellyfiSSH iTerm and “builtin” ssh. I can work with screen or tmux too. But as System Engineer I have at work sometimes a bunch of open PuTTY sessions. What I miss most is the ability to reconnect or duplicate session with one mouse click. When you are troubleshooting a big network with tons of switches and routers, then You know the benefits of it. And if you have something on the serial console too, it has exact the same Interface. And ad Winfried says: The Cut and Paste behavior is strange. But extreme fast and easy.. PuTTY was for me the most valuable free (MIT Licence) Windows tool ever. It is a pity, that nothing similar is available for OSX

  4. Eric

    While the built-in terminal is good for 90% of people it’s emulation is lacking in several key areas. Putty bests terminal in completeness of it’s emulation, accuracy of emulation, and surprisingly UTF-8 accuracy. It would be great to see a cocoa native putty derivative some day.

  5. CB

    One thing putty is nice about is allowing the use of a http proxy to tunnel my ssh connection through. My company forces all ssh traffic through ssh.mycompany.com and putty is the only client I’ve ever seen to allow the use of this. If you know of another, please let me know!

  6. monkster

    Another cool thing PuTTY does is to allow you to have different look and feel for all your various ssh sessions. When the font and colors are different, it helps if you tend to get disoriented when switching between open sessions.

  7. I’ve used Linux for years. However recently I started to run Putty under WINE in Linux. Ssh doesn’t let me send keep alives from the client. Putty does, plus I can save and load configs. I’m sold it’s Putty for me and one of my first actions when setting up a new Mac is to get Putty going.

  8. Daniel

    You are aware that OpenSSH also ships with a client config under every unix based OS?

    botch:~ zee$ grep -i alive /etc/ssh_config
    ServerAliveInterval 240
    botch:~ zee$ uname -a
    Darwin botch.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

  9. bluemonkey

    you know, iTerm has the same “select is copy” behavior of Putty, which was my fave thing about Putty. you gotta command-v to paste, not right click, but to me that’s just as quick. Also, iTerm has bookmarks, which are fairly similar to stored sessions in Putty. So… for me it works as well as Putty, hopefully others coming here with Putty-withdrawal symptoms will have the same experience as me.

  10. monkster, Terminal allows you to change colors and fonts too. You can find it easily in the settings.

  11. alt

    I’m used to using the Alt key in Linux as a replacement for Esc, as in Alt-. instead of Esc . but in Terminal, the Alt key doesn’t work that way, it causes it to generate international characters instead, which I don’t need. Putty does this right on Windows, so I’ll have to give it a try on the Mac.

  12. askh

    in Snow Leopard default Termianl app provides the same functionality as Putty for Duplicate Session and storing connection presents as following:

    1. In Preferences on Settings page duplicate your favorite setting (Pro for instance) and add desired remote connection command for Startup in Shell subpage (ssh [email protected] for example) naming this setting (let’s say) ‘MyPro’

    2. Start first terminal session MyPro as Tab, than if you right-click on it’s tab you can select “New Tab with Settings – MyPro” from dropdown menu that will duplicate your session.

    3. Or if you right-click on a tab bar empty space you can do “New Tab->MyPro” from context dropdown menu and open new tab with desired session preset.

    4. For Serial connection use command “screen /dev/tty. 115200” for example

  13. Bob

    I use PuTTY to connect to VMS systems where I need the VT100 EDT/TPU keypad mapping. I haven’t been able to get this to work with either Terminal or iTerm.

    If someone can explain how to get everything to work, including the “GOLD” (numlock) key behaving as it does on a VT, I’m interested. Otherwise I still need something else for our new Mac.

  14. Tom

    This was clearly written by someone that has never actually tried to use the serial functionality of the OSX terminal and probably has never actually used any sort of serial terminal or serial terminal emulation before. The OSX terminal app is worthless for serial stuff even if it is fine for ssh. Screen is a little better but, still not real terminal emulation. Putty is the best free application by far. There are some better commercial ones though. They are usually expensive as they are usually sold to companies not individuals.

  15. Mark

    The problem with this review is that it does not explain how horrible the OS X terminal is. Those of us who have used real X terminals enjoy copy-on-select and paste-on-middle. We like to turn off alternate window switching (or, at least have the option). Putty running on OS X really is a joy.

  16. SO

    As “Mark” above says, this article misses how bad the behavior of Terminal really is on a regular basis, it is better than the Windows command line interface (by a lot), but it has a lot of annoying quirks and some of them cannot be easily worked around. As some other posters also noted PuTTY was ported to Linux because of popular demand, and it wasn’t the middle click copy option (a unix gui standard for a very long time), it was the very good terminal emulation and the way PuTTY almost always behaves properly, no line overlaps, no odd mouse behavior, the default settings are very good.

  17. MM

    You guys should try Secure CRT. It can do everything this free ware can do and more. There is a 30day trial for OSX.

  18. Guy

    MM is correct. I use Secure CRT everyday and although Putty works, Secure CRT is superior when you need to have multiple sessions open and use numerous scripts. But, Putty is a great free app while Secure CRT is a great paid app.

  19. mrsleep

    Gotta love righteous *nix nerds who can’t see ANY reason why you want might want expanded functionality out of your telnet client.

  20. John

    Unless I’m missing something because I have been searching for months, the Mac SSH client doesn’t allow you to save SSH pre-set session.

    I like how people like to dismiss Putty in the Mac world saying “oh all you need is to type xyz into the terminal and you got ssh”. Sure, that is right. However, how you ever tried to manage 20+ servers using ssh? It is the pain in the ass to connect to a server quickly in Mac OSX even with the help of copy&paste pre-written login, let alone typing ssh -i path [email protected] every time.

    With putty, my efficiency is so much higher by just clicking the name of the server I want to connect.

    • Paul

      John, a solution is nearby… just use a shell-script. And if you have a team of users needing it, mass distribution is easy. Only change the relevant usernames and off you go.
      At the terminal-prompt in your home-dir, just type ‘go two’ to get to server two. With certificates installed, it’s the fastest getting to a large number of servers without thinking twice or browsing through interfaces. Sometimes less is more.. and especially in incident situations, this is very fast and convenient. And less error-prone.

      Example script (just use f.e. vi and paste it in..):
      #!/bin/sh
      Make ssh connection to one of the linux boxes
      in file .bash_profile
      # # My shortcuts
      # alias go=/home/yourusername/go
      or
      # add the following line in your $HOME/.bash_profile
      # export PATH=$PATH:$HOME
      # option on debian-boxes: alias ifconfig=/sbin/ifconfig
      #
      VAR1=myusername1
      VAR2=myusername2
      case “$1” in
      # the telnet-boxes
      ‘t1’) /usr/bin/telnet 10.20.10.2;;
      ‘t2’) /usr/bin/telnet 10.20.10.3;;
      # some Servers
      ‘one’) /usr/bin/ssh ${VAR1}@10.20.10.4;; # description if you like
      ‘two’) /usr/bin/ssh ${VAR1}@10.20.10.5;; # another one
      # other Servers
      ‘ten’) /usr/bin/ssh ${VAR2}@10.20.10.6;;
      ‘eleven’) /usr/bin/ssh ${VAR2}@10.20.10.5;;
      # Wildcard:
      *)
      /usr/bin/ssh [email protected]$1 ;;
      esac

  21. klabelkholosh

    Google “iTerm 2” and thank me later. One-click-to-connect, multiple stored profiles, custom fonts, grid view with 4 open sessions each differentiated by translucent graphical backgrounds, all kinds of completely awesome stuff. I also went looking for Putty OSX coming from Windows, found iTerm 2 and never looked back!

  22. Good points noted from posts above but the major problem with terminal is that it doesn’t work correctly/reliably after re-sizing the terminal window when using less and most importantly vi, both of which are essential programs.
    I use putty running in a VirtualBox at the moment. Mainly so I can use Winamp as a replacement for that AWFULL iTunes thing. (flame away :-/)

  23. Jorge Medina

    Do anybody has experienced the following?
    in Mac OS X 10.7.4 , the terminal app seems to freeze my system after working on sessions that produced a lot of output and scroll for thousands of lines. This happens after I have my computer put to sleep and try to wake it up. It seems Terminal is trying to load the buffers with the output of the sessions. It should only keep a few hundred/thousands lines and I should be able to control how much history to keep! The more I use Mac, the more I love Linux and Solaris

  24. Anonymouse

    Yes, the default terminal.app is lacking. I use iTerm2 for everything, I don’t like alot of GUI apps. I had to tftp firmware to my router to unbrick it, tried some GUI tftp clients with no luck; tried command-line tftp in iTerm 2, worked first time!

  25. With PuTTY, I could use Emacs on the remote system, and have all the keys mapped correctly. I have not found a way to do that with Terminal. Just trying to get a ‘Meta’ key working is a nightmare.

  26. some human

    You’re confused. Why would people want putty for SSH? You have a regular native ssh already.

    The reason to want Putty is because its terminal emulation and UI is very good. Terminal is terrible. For example, terminal doesn’t even pause output when selecting text, so trying to select text in a scrolling window is impossible. The cursor color is handled wrong, so you often can’t even see the character under the cursor.

  27. Jarrod

    You guys are missing the point in my opinion. Yes, there is a terminal in OSX just like there is a terminal in Linux. I use Linux for all my home computers and my company just switched from Windows to OSX. I’m looking for something like putty because I manage 30-40 servers and honestly don’t want to commit all their DNS names to memory. I like having all the settings saved for each one and not having to type ssh [email protected] each time, especially when some of those URLs change from time to time. I guess I’ll keep looking, but it’s frustrating that all my Google searches show articles like this. Telling people not to use putty doesn’t really answer their question of finding a true replacement.

    • Paul

      Jarrod, I’m managing the same amount. See the shell-scrit example.

  28. You are so awesome! I do not believe I’ve truly read anything like
    this before. So great to discover someone with genuine thoughts on this subject.
    Seriously.. many thanks for starting this up. This web site is one thing that’s needed on the web, someone with a bit of originality!

  29. I knoww thiss if off topic but I’m looking into starting my own weblog and was wondering what all is required tto get set up?

    I’m assuming having a blog like yourss woul cost a pretty penny?
    I’m not very internest savvy so I’m not 100% sure.
    Any recommendations orr advice would be greatly appreciated.
    Thanks

    Feel free to visit my blog: Nashville”s Best Chiropractor

  30. It’s hard to find your page in google. I found it
    on 16 spot, you should build quality backlinks , it will help you to increase traffic.
    I know how to help you, just search in google – k2 seo tricks

  31. I must thank you for the efforts you have put in writing this website.
    I really hope to view the same high-grade content by you later on as well.
    In fact, your creative writing abilities has motivated me to get my
    very own website now 😉

  32. I read a lot of interesting posts here. Probably you spend a lot
    of time writing, i know how to save you a lot of work, there is an online tool that creates unique, SEO friendly
    posts in minutes, just search in google – laranitas free content source

  33. The convenience of these machines is hard
    to match. You may wonder what they can offer you that a regular oven doesn’t
    have, and that would be a greater precision in what you’re cooking,
    meaning no failed recipes or undercooked food.
    Toaster ovens, which can cook anything from toast to whole chickens,
    reduce the use of oil compared to a fryer resulting to a healthier meal.

    My homepage – passione

  34. Baylink

    If we have learned anything in almost 4 decades of Computer Mediated Communications, it’s that “you shouldn’t want that” is never a productive response to someone’s inquiry.

    Particularly, in a case like this, it implies that you don’t think the person asking is smart enough or thorough enough to have done their own due diligence on the alternatives and how those might or might not meet their needs.

    I don’t use Putty on SuSE largely because the Konsole emulator I run it in is tractable enough that I don’t need it to provide the help. And it’s generally a different set of computers that I’m talking to when that’s the tool I have handy.

    I will probably install it on my new MBP, though, if only to try out.

    I do find it vastly amusing, though, that the Apple fanboys who are opining so strongly that it’s unnecessary are also the people advocating that “you can do all that stuff, just go open this config file with a text editor and change it that way.”

    I’m gonna want gvim, too. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

7,971 views42 comments