Loading ...
Sorry, an error occurred while loading the content.

OpenSSH from Mac OSX

Expand Messages
  • arjanvankesteren
    Hi, I ve recently made the switch from WinXP to a OSX laptop which is slowly taking over the role of my main computer. Obviously I also want to be able to log
    Message 1 of 7 , May 24, 2006
    • 0 Attachment
      Hi,

      I've recently made the switch from WinXP to a OSX laptop which is
      slowly taking over the role of my main computer. Obviously I also want
      to be able to log in to my slug from my Mac. I had already installed
      OpenSSH before on my WinXP PC and that worked fine with PuTTy and
      WinSCP; tonight I followed the steps found on
      http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccessMacUsers
      I skipped the first parts as I had already done those through WinXP,
      and started at Install and Configure SSH Client. Generating keys on
      the Mac went without a hitch, but I'm stuck on copying the keys to the
      slug through scp:

      # Copy the '''public key''' to the NSLU2
      ...
      To copy files, use the following command in a Terminal window :
      scp ~/.ssh/id_dsa.pub root@nslu2_ip_address:~/.ssh/authorized_keys
      scp ~/.ssh/id_rsa.pub root@nslu2_ip_address:~/.ssh/authorized_keys

      I keep getting 'permission denied, lost connection' messages. I sorta
      get the permission denied part, the slug is expecting my old WinXP
      login, right? This leaves me in a catch-22: I need to upload new keys
      to use SSH, but to do that I need to establish a SSH login using the
      old key which isn't on my new Mac, so... how can I get my new Mac keys
      to the slug, or can I 'just' copy the WinXP key to the Mac?
      Another thing: on creating RSA1 keys, I get identity and identity.pub
      files instead of id_rsa.pub. I'm guessing that's not gonna be a
      problem? I'll update the wiki if I can get this to work somehow... any
      help is appreciated.

      For completeness sake, here is the file listing of ~/.ssh on the Mac:
      id_dsa; id_dsa.pub; identity; identity.pub; known_hosts
    • Herman I. May
      , I am getting the impression you have only a limited familiarity with SSH. So, it might be easiest for you simply generate new keys based on the IP
      Message 2 of 7 , May 25, 2006
      • 0 Attachment
        <anonymous>,

        I am getting the impression you have only a limited familiarity with
        SSH. So, it might be easiest for you simply generate new keys based on
        the IP address and login ID from the Macintosh.

        Copying the keys from the WinXp box to the Macintosh is not going to
        work unless you have configured the Mac OS system with the same IP
        address as the Windows machine on which they were generated.
        Otherwise, yes, that is a possible option.

        The Mac OS comes with openSSH and and openSSL preinstalled. As such,
        there is already a CLI SSH client. Perhaps you are referring to a GUI
        client. Fugu is very good, IMO.

        The "identity.*" files you are generating are based on the RSA1
        algorithm — as the tutorial indicates. If you want an "id_rsa.*" key,
        you would need to designate the RSA2 ("-t rsa2") algorithm when
        generating the key(s).

        I would suggest you access the command line on your Mac OS box and
        read (or reread) the man pages for "ssh" and "ssh-keygen" for more
        information.

        Herman
      • Michael Homscheidt
        Hi, I m using OpenSSH from my Mac without any problems. The only difference is (see also the Mail from Herman I. May) that I started from scratch and
        Message 3 of 7 , May 25, 2006
        • 0 Attachment
          Hi,

          I'm using OpenSSH from my Mac without any problems. The only
          difference is (see also the Mail from Herman I. May) that I started
          from scratch and generated all keys again (after upgrading from
          Unslung 5.5 to 6.8)

          Regards
          Michael.
        • Arjan van Kesteren
          ... I thought I was doing that? The problem isn t creating new keys on the Mac, it s in copying them from the Mac to the slug. I ll rephrase my question: how
          Message 4 of 7 , May 25, 2006
          • 0 Attachment
            Herman I. May schreef:
            > <anonymous>,
            >
            > I am getting the impression you have only a limited familiarity with
            > SSH. So, it might be easiest for you simply generate new keys based on
            > the IP address and login ID from the Macintosh.
            I thought I was doing that? The problem isn't creating new keys on the
            Mac, it's in copying them from the Mac to the slug. I'll rephrase my
            question: how do you copy / append Mac-generated ssh keys to the
            autorized_keys file on the slug whilst sshd is running on the slug
            (which has been set up earlier from WinXP)?
            Oh, I tried killing the sshd process, then the scp command from the
            tutaorial - no luck, connection on port 22 is refused.
            > The Mac OS comes with openSSH and and openSSL preinstalled. As such,
            > there is already a CLI SSH client. Perhaps you are referring to a GUI
            > client. Fugu is very good, IMO.
            Not a question I had but thanks for the suggestion anyway
            >
            > The "identity.*" files you are generating are based on the RSA1
            > algorithm — as the tutorial indicates. If you want an "id_rsa.*" key,
            > you would need to designate the RSA2 ("-t rsa2") algorithm when
            > generating the key(s).
            Thanks you for clearing that up, but you're wrong about the tutorial -
            it quite clearly states (or at least implies) that using ssh-keygen -t
            rsa1 yields id_rsa.pub and id_rsa files.

            Arjan
          • Michael Homscheidt
            Hi, just a little correction for Mac OS X. ... The t -rsa2 is not known by ssh-keygen on Mac OS X. According man - ssh-keygen : The possible values are
            Message 5 of 7 , May 26, 2006
            • 0 Attachment
              Hi,

              just a little correction for Mac OS X.
              >
              > The "identity.*" files you are generating are based on the RSA1
              > algorithm — as the tutorial indicates. If you want an "id_rsa.*" key,
              > you would need to designate the RSA2 ("-t rsa2") algorithm when
              > generating the key(s).
              >
              The "t -rsa2" is not known by ssh-keygen on Mac OS X. According "man -
              ssh-keygen": "The possible values are ``rsa1'' for protocol version
              1 and ``rsa'' or ``dsa'' for protocol version 2." This means that
              "ssh-keygen -b 1024 -t rsa" will generate a rsa2 key under Mac OS X.

              Regards
              Michael.
            • Herman I. May
              ... It is now quite clear that you have no familiarity with SSH, but that is alright, cause we are here to help. :-) As I stated earlier, you do not need to
              Message 6 of 7 , May 26, 2006
              • 0 Attachment
                --- On 20050526@17:48CDT, Arjan van Kesteren <arjan@...> wrote:

                > I thought I was doing that? The problem isn't creating new keys on the
                > Mac, it's in copying them from the Mac to the slug. I'll rephrase my
                > question: how do you copy / append Mac-generated ssh keys to the
                > autorized_keys file on the slug whilst sshd is running on the slug
                > (which has been set up earlier from WinXP)?

                It is now quite clear that you have no familiarity with SSH, but that
                is alright, 'cause we are here to help. :-)

                As I stated earlier, you do not need to copy the keys, per se. Once
                you successfully login to the SLUg via SSH, your public key from the
                Mac OS machine will be saved in the "known_hosts" file. You can then
                fire up an editor and copy that key from "known_hosts" to your
                "authorized_keys" file, if your goal is to have trusted access without
                the need to provide a password.

                If you insist on copying the public key from the Macintosh to the SLUg
                by other means, then you will need to login via other means (e.g.
                telnet in, mount the directory tree as a shared volumes and edit the
                file directly, etc. ...something other than SSH).

                > Thanks you for clearing that up, but you're wrong about the tutorial -
                > it quite clearly states (or at least implies) that using ssh-keygen -t
                > rsa1 yields id_rsa.pub and id_rsa files.

                Ummm, no, I am not incorrect — and certainly not wrong! ;-). It would
                not be the first time that the wiki was mistaken and, thanks to
                Michael Homscheidt, an addendum has been added to clarify the
                erroneous information. Regardless, had you read through the relevant
                man pages, you would have gleaned the correct syntax for the desired
                application.

                BTW, Michael, you are quite correct: the correct command is simply "-t
                rsa". My mistake and I thank you for the clarification.

                Herman
              • arjanvankesteren
                ... Appreciate it! ;-) I m not intentionally being difficult here, just frustrated I can t get this to work. ... Until now, I haven t been able to login via
                Message 7 of 7 , May 26, 2006
                • 0 Attachment
                  Herman I. May schreef:
                  > It is now quite clear that you have no familiarity with SSH, but that
                  > is alright, 'cause we are here to help. :-)
                  Appreciate it! ;-) I'm not intentionally being difficult here, just
                  frustrated I can't get this to work.
                  > As I stated earlier, you do not need to copy the keys, per se. Once
                  > you successfully login to the SLUg via SSH, your public key from the
                  > Mac OS machine will be saved in the "known_hosts" file.
                  Until now, I haven't been able to login via SSH, not with my Mac at
                  least. Connection keeps getting denied whenever I try.
                  > Ummm, no, I am not incorrect — and certainly not wrong! ;-) .
                  No offence meant, rest assured ;-) What I *should* have said was that
                  your info differed from the wiki. As you correctly surmised, my
                  knowledge of SSH is not very substantial. I just tried to follow the
                  wiki as best I could (hey, it worked for SSH on WinXP...)

                  Arjan
                Your message has been successfully submitted and would be delivered to recipients shortly.