Jon AtkinsonI'm a web developer and system administrator

Posts tagged with 'xen'

Creating Xen DomU's, now with actual connectivity

Posted on 2nd November 2007. Tagged as mampi, tips, xen

xen-tools is a useful connection of scripts.

However, when you're creating a new Xen guest, don't forget to specify the correct gateway and netmask. Otherwise, you may end up spending a whole evening trying to figure out a routing problem which doesn't actually exist.

xen-create-image --hostname=example.com\ 
--ip=XXX.XXX.XXX.XXX\
--gateway=XXX.XXX.XXX.XXX\
--netmask 255.255.255.0\
--dist=etch\
--passwd\
--boot

SSH on multiple ports with OSX 10.5

Posted on 1st December 2008. Tagged as xen, osx, mac, ssh

I want my Mac Mini running Leopard to listen for SSH connections on multiple ports. This proved to be far more difficult that it should have been. For the sake of this example, lets say SSH should listen on port 22, which is the default, and port 10022.

On most unixes, you just edit /etc/sshd_config to contain the following:

Port 22
Port 10022

Then you restart SSH, and you're done. Things aren't so simple since Apple introduced launchd.

First, you need to duplicate the existing launchd service description file, like this:

sudo cp /System/Library/LaunchDaemons/ssh.plist /System/Library/LaunchDaemons/ssh2.plist

Then, edit the ss2.plist file as follows. The keys actually changed are Label and SockServiceName:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList
-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.openssh.sshd2</string>
<key>Program</key>
<string>/usr/libexec/sshd-keygen-wrapper</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/sshd</string>
<string>-i</string>
</array>
<key>SHAuthorizationRight</key>
<string>system.preferences</string>
<key>SessionCreate</key>
<true/>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>Bonjour</key>
<array>
<string>ssh</string>
<string>sftp-ssh</string>
</array>
<key>SockServiceName</key>
<string>ssh2</string>
</dict>
</dict>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>

Finally, you need to add your new SSH port to /etc/services. Append lines like this at the end of that file:

ssh2              10022/udp 
ssh2 10022/tcp

Now you need to instruct launchd to start this service (it should start automatically on bootup thereafter)

sudo launchctl load -w /System/Library/LaunchDaemons/ssh2.plist

Finally, check that everything works correctly:

ssh -p 10022 localhost

Twitter

About Me

Picture of Jon Atkinson

Jon Atkinson is a web developer, sysadmin and occasional business guy. He works in the north west of England.

Jon can be contacted at , or on freenode as JonA. Also available: twitter, LinkedIn and Github.

84labs logo

I own and run 84labs, a company which provides bespoke web application development for businesses and startups.

If you're interested in working with me, take a look, then contact me via 84labs.

Testled logo

I'm one of the founders of Testled.com, a web service to provide simple remote usability testing of web sites and desktop applications

Testled.com is currently in private beta, but you can still signup for an invite.