Using SSH Keys between two servers

Discussion in 'Server Operation' started by atjensen11, May 28, 2008.

  1. atjensen11

    atjensen11 New Member

    I have two Ubuntu servers, both of which have SSH access available.

    One server is a publicly accessible server. I have it segragated fairly well on the network from LAN machines. This public server only allows SSH connections using a public/private key pair.

    Normally, I connect to the machine with a Windows computer using Putty. Putty is configured on this computer to login with the private key.

    However, I now added the second server to the network. I would like to be able to SSH from that server into the first public server. I want to be able to use SSHFS to mount drives and so forth, mainly for transferring files and performing backups.

    How do I configure the second server with the appropriate private key (the one I currently use with Putty) so that the first server accepts the login credentials?

    (As a side note, I would be open to comments on my backup solution. I already have an external HD mounted on the public server. I was thinking of using SSFS to mount the folder where the external HD is mounted on the first machine to the second machine. I would then write my backups from the second server to the external HD through SSHFS.)

  2. falko

    falko Super Moderator ISPConfig Developer

  3. atjensen11

    atjensen11 New Member


    Thanks for the suggestion on the rsync option Falko. I checked it out last night and it too appears to be a viable backup option.

    However, I did solve my problem last night. As I suspected, it had to do with SSH key autorization and nothing really to do with SSHFS.

    Since the first machine is configured only to accept key based authentication, I had to create a public/private key pair on the second machine. The second machine is the SSH client in this particular setup.

    I created a key pair on the second machine and then copied the contents of the newly created public key, placing the key after the other keys already in the authorized_keys file on the first machine.

    Now that I can SSH into the first machine, I can use SSHFS from the second machine to mount a folder from the first machine remotely to the local file system. The cool thing, I think anyhow, is that the folder I am mounting is actually mounted to the first machine. Although I haven't done it yet, SSHFS can be configured is fstab to perform the mount automatically as well. So there are a lot of potential options.

Share This Page