Web Admin Blog Real Web Admins. Real World Experience.

20May/150

SSH on a Mac Errors with “Write Failed: Broken Pipe”

Recently I had an issue when moving to a new Mac on OSX when I was trying to SSH to a Linux server.  It would make the initial connection and then prompt me for a password.  Once I entered the password, however, it would just hang (ctrl+c wouldn't even escape out) until eventually it would break to the command line with the message "Write Failed: Broken Pipe".  After digging through various posts online, most of which were referring to timing out due to inactivity, I finally found a winner.  I edited the /etc/sshd_config file and set the ClientAliveInterval value to 300.  Then, I rebooted my Mac.  The next time I tried to SSH to the same server, everything connected as expected.  I hope this helps someone else in the future who is running up against the same issue I had.

9Apr/091

Who Needs VPN When You Have PuTTY?

I was talking with my coworkers this afternoon about Time Warner's plans to jack up rates for high-bandwith users and it got me thinking about how much of their precious bandwith I am actually using.  I know that my router at home has a web browser interface where I can get that information, but I have it intentionally only allowing access from the local area network interfaces.  I needed to find another way to view the site from work while making the router think that I was on the right network.  What I ended up doing was using PuTTY to create a SSH tunnel from my work computer to my Linux box on the home network.  I then just pointed my browser at the forwarded port on my work computer and up comes my router's web interface.  Who needs VPN when you have PuTTY?  Anyway, here are the exact steps that I took to do this:

  1. Start PuTTY
  2. Under Connection->SSH->Tunnels specify a source port (the localhost port you want to connect to) and a destination (IP:port) that you want to connect to on your home network.
    • Source port: 8008
    • Destination: 192.168.0.1:80 (or whatever IP your router is at and it's web interface port)
  3. Click "Add"
  4. Under "Session" specify the host name for your SSH server that lives on your internal network, but is exposed via port forwarding on your router with port 22.
  5. Click "Open"
  6. When prompted, enter your username and password for your SSH server.
  7. Now just pull up your favorite web browser and navigate to http://localhost:8008.  You should see the page just like you would if you were sitting at home.
Tagged as: , , , 1 Comment