Tuesday, July 10, 2012

Configuring Remote X11: MacOS Lion

Configuring OSX to be able to display remote X11 (X.Org) applications on the local (MacOS Lion) display.

  • Reconfigure X11 on OSX to listen to TCP port 6000 if it doesn't already.
    • Move on to the next section if

      % defaults read org.x.X11 | grep nolisten
      "nolisten_tcp" = 0;
    • Enable the X11 server to listen on it's tcp port.

      % defaults write org.x.X11 nolisten_tcp 0
  • Make sure xauth is installed on the remote server.

    % which xauth
  • Start an ssh session with X11 forwarding enabled.

    % ssh -X remote-host
  • Open xcalc on the remote server and verify it comes up on your local display.

Monday, July 2, 2012

Configuring PuTTY: Transparent Multi-hop SSH

Many environments require that you login into a gateway server before being able to login into the remote server you actually want to get to.  In these cases you can configure PuTTY to proxy through the gateway server so that it looks as though you're going directly to the remote server.

The following examples assumes OpenSSH on the remote server and gateway and Windows7 on the Desktop.

  • Login into the gateway server and add your to to the authorized keys file 
    • ssh-add -L >> ~/.ssh/authorized_keys
  • Configure PuTTY Proxy Tab
    • Proxy type: Local
    • Proxy hostname: (gateway server here)
    • Exclude Hosts/IPs: (gateway server here)
    • Username: (gateway username here)
    • Local Proxy Command:  plink.exe %user@%proxyhost -nc %host:%port \n

  • Login into the remote server and add your key to the authorized keys file
    • ssh-add -L >> ~/.ssh/authorized_keys


Configuring PuTTY: Pageant

Setting up PuTTY's Pageant.
  • Follow Configuring PuTTY: Generating SSH Keys
  • Create a shortcut for Pageant
  • Move the shortcut into Startup
  • Append the Putty Private Key to the shortcut's Target property
  • Logout, Login and Verify Pageant starts up and prompts for the passphrase


Configuring PuTTY: Generating SSH Keys

There are two options to generating keys for PuTTY's puttygen.
  1. Import OpenSSH keys
  2. Generate PuTTY SSH keys
  • Follow Configuring PuTTY: Installing PuTTY Software
  • Start PuTTY's puttygen program
  • Set SSH-2 RSA keys to generate.
  • Select: "Conversions → Import" OR "Generate"
  • Save public key (..\Desktop\putty_key.pub)
  • Save private key (..\Desktop\putty_key.ppk)

Configuring PuTTY: Installing PuTTY Software

This article assumes you are installing on Windows7 (64bit).
  • Download PuTTY installer and execute
  • Append PuTTY's install path (C:\Program Files (x86)\PuTTY) to Windows7 Path Environment Variables