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 0.0.0.0:9001:<ip-of-the-container>:22 localhost

6) Now connect to the tunnel using

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

One thought on “SSH Tunneling into LXC containers

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s