Linux Distribution · LXC

SSH Tunneling into LXC containers

After LXC package installation configure the lxc /etc/init/lxc-net.conf to look like

env USE_LXC_BRIDGE="true"

Restart lxc-net service.

# /etc/init.d/lxc-net restart

Start the container

# lxc start <container-name>

After entering into the console of the container. Find the IP of the container.

In host machine use the following command to create the tunnel listening on the port 9001

# ssh -L<ip-of-the-container>:22 localhost

6) Now connect to the tunnel using

$ ssh -p 9001 <userid>@<ip-of-the-host>

One thought on “SSH Tunneling into LXC containers

  1. Great website. Lots of useful information here. I am sending it to some buddies ans additionally sharing
    in delicious. And of course, thank you for your effort!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s