Computer Scientist, Graduate Student, and Geek

Tag: ssh

Fix X11 Forwarding over SSH in Ubuntu 10.04 (Lucid)

October 13, 2011

There is a bug in Ubuntu Lucid’s sshd (SSH server) that causes issues with IPv6-enabled network interfaces preventing X11 forwarding over SSH from working properly. The error in /var/log/auth.log is:

error: Failed to allocate internet-domain X11 display socket.

To fix the issue, you need to tell sshd to only listen to IPv4. Add the following line at the top of /etc/ssh/sshd_config (before the Port configuration):

AddressFamily inet

Solution is from: http://www.se.cuhk.edu.hk/~hmleung/wordpress/?p=876

Categories: Linux, Networking

Tags: ssh, ubuntu


sshd in Ubuntu

December 28, 2010

By default, Ubuntu does not have sshd installed and configured. To be able to ssh into your machine, run:

sudo apt-get install openssh-server

Categories: Linux

Tags: apt, ssh, ubuntu


Key-Based SSH Login with PuTTY

April 15, 2010

I'm a Linux user at heart, but there are still instances when I need to use Windows. I am used to having an SSH agent and key-based login on Linux, so I wanted to setup PuTTY to do the same on my Lenovo X201 laptop running Windows 7. I followed the instructions at http://www.howtoforge.com/ssh_key_based_logins_putty and it worked perfectly. I also added the pageant shortcut to my Startup items folder, so pageant automatically starts when I login, and the ThinkVantage password manager prompts for my fingerprint to unlock the key.

Categories: Linux

Tags: putty, ssh, windows


Mercurial Over SSH

April 12, 2010

To clone a Mercurial (hg) repository over SSH, use the command

hg clone ssh://hostname/path/to/repo
replacing hostname with the hostname of the computer who you would like to connect to via SSH to obtain the repository and path/to/repo with the path to the repository, relative to your home directory. To use a directory relative to the root directory of the remote host, add additional slash after the hostname
hg clone ssh://hostname//path/to/repo

Categories: Development, Linux

Tags: mercurial, ssh


Tab Completion of SSH Hosts

August 28, 2009

I was tired of having to type full hostnames every time I wanted to SSH to a computer I commonly use. So, I setup tab completion for hostnames when I use SSH or SCP. The process involved only 3 simple steps.

  1. Create a file .hosts in your home directory. In the file, put the hostnames of computers you commonly connect to, one per line. Example .hosts file:
    subdomain.domain.com
    computer.domain.com
  2. Add three lines to your .bashrc file:
    HOSTFILE=~/.hosts
    complete -f -A hostname scp
    complete -A hostname ssh
  3. Enter the command
    source ~/.bashrc
    to reload your settings.

Categories: Linux, Networking

Tags: bash, ssh


DD-WRT Password Reset

August 06, 2009

I had SSH enabled on my router running DD-WRT v24 and my SSH key installed, allowing me to SSH into the router. However, I could not remember the password for the web interface. I used the instructions at http://www.righteoushack.net/?p=262 to reset the password by modifying NVRAM values using SSH.

Categories: Linux, Networking

Tags: dd-wrt, ssh