Category: Ubuntu
Make svnserve support multiple SVN users for one SSH account
By Chee Ming on Mar 29, 2009 | In Technical, Ubuntu, Linux, Subversion | Send feedback »
I am using A Small Orange to host some of my stuff and I wanted to setup Subversion (SVN) to work there. It was pretty simple since this hosting company supports SVN through svnserve. How cool is that? ![]()
But the problem that I encountered with this is that I wanted to support more than one user. In the beginning I was thinking that I needed to share the single username and password with everyone that is working on the same SVN repository (or share a single private key). Oh the security implications that would bring!
But I soon realised that with svnserve and some SSH config tricks I can support multiple users on the repository. And the good thing is that I don't have to mange these damn passwords. I always preferred password-less setups with key pairs (many thanks to all the work done by people to make PKI possible).
And another good advantage is that you can restrict the user that is logging through SSH to only have access to some specific directory.
I found the details for this here (I think the A Small Orange community is really helpful). The only thing to look out for is that in Ubuntu 8.10 when you run the following command:
ssh-keygen -t dsa -f dev-dsa -P '' -C developer001
The password is not actually empty, it would be better to drop the -P and then enter an empty password in the input, instead of entering empty string at the command line. The same command worked fine in my Mac OSX 10.5.6.
And finally the new URL to access the repository is slightly different, it will be relative to the virtual directory that you point each user in your authorized_keys file to.
I actually use git svn quite a lot these days and I haven't really tested this with my git svn setup because the URL to the path of the SVN repository has changed and I am not sure what implications it would have on the git svn repository that is still referring to the old URL. I am keeping the old and new style for now until I figure things out.
I just wanted to share that although hosting a SVN repo behind Apache is probably one of the most popular ways to deploy Subversion repositories but I think this method has some distinct advantages and its quite flexible if you want finer grain control of security options, permissions and access controls.
Hope this hint help others out there and if anyone has done some work with git svn and changing of svn remote URLs, then it would be nice to hear from you.
Mounting an NTFS partition in Ubuntu
By Chee Ming on Nov 12, 2007 | In Technical, Exoweb, Ubuntu | 2 feedbacks »
I am not sure why I keep on encountering problems when mounting an NTFS partition in Ubuntu. I get the following error message when doing a mount:
fuse: mount failed: Device or resource busy FUSE mount point creation failed Unmounting /dev/sda1 ()
I remember I did a lot of research and still did not manage to find out why. But I did find some instructions on how I can resolve it. First do the following:
ls -lh /dev/mapper
If your partition is indicated there, it means its busy. It might look something like the following:
total 0 crw-rw---- 1 root root 10, 63 2007-11-13 06:09 control brw-rw---- 1 root disk 254, 0 2007-11-12 22:10 sda1 brw-rw---- 1 root disk 254, 1 2007-11-12 22:10 sda5 brw-rw---- 1 root disk 254, 2 2007-11-12 22:10 sda6
Then do the following:
dmsetup remove_all
And try again! Good luck!
The wireless challenge
By Chee Ming on Sep 21, 2007 | In Technical, Exoweb, Ubuntu | Send feedback »
I managed to get my Dell Inspiron 510m laptop connected to a WPA2 with AES encryption and hidden SSID by doing some minor hacks with configurations files. But I was not totally happy with the setup because it didn't jell nicely with the GNOME NetworkManager.
At first, it just didn't seem to work. I had no idea why. I did some reading online and stumbled upon this short article.
The most important part that would get NetworkManager to work properly is to remove the configurations in /etc/network/interfaces. Just comment out everything except the stuff for the local loopback (lo).
But it wasn't over yet. I still didn't manage to connect to the wireless network at home. It seems although the wireless router is configured to use WPA2 Personal, it might not be so when configuring the settings. One way to find out would be to use the following command:
iwlist eth1 scanning
Replace eth1 with the wireless interface for your laptop and scan for something that looks like this:
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
So just use those settings there and it should all fall in place.
I never realised that connecting to a wireless router can be so challenging. ![]()
Configuring Ubuntu 6.10 (Edgy) to work with WPA2 Personal with AES and hidden SSID
By Chee Ming on Sep 10, 2007 | In Technical, Exoweb, Ubuntu | Send feedback »
I wanted to connect my Ubuntu to the wireless configuration mentioned above and realised that my GNOME network manager only supported WEP. I did a bit of research online and found a ton of info but the most useful for my case was the wifi doc from Ubuntu website. By the way, I am using a Dell Inspiron 510m.
I did a bit of hacking around and finally found a way.
- Install WPA supplicant like this: apt-get install wpasupplicant (requires root access)
Create the config file for WPA supplicant. I saved it at
/var/run/wpa_supplicant.conf/etc/wpa_supplicant/wpa_supplicant.conf (you probably need root access). It will look something like this:network={ ssid="[ENTER SSID HERE]" scan_ssid=1 # use this when access point using hidden ssid proto=WPA key_mgmt=WPA-PSK psk=[ENTER PSK HERE] # generate this using wpa_passphrase }- Generate your PSK using the wpa_passphrase program
Edit the /etc/network/interfaces file (again root access). For my setup it is eth1 for the wireless. So I just put the following
23 lines afteriface eth1 inet dhcpas such:auto eth1 iface eth1 inet dhcp wpa-driver wext wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf wireless-essid [ENTER SSID HERE]
wext is the driver that I am using. I guess this might be different depending on your setup. Check the man for wpa_supplicant to get an idea. The wpa-conf part points to the config file that was created earlier. The wireless-essid setting is also required, although it seems there is a duplication.
There is a line that looks like
auto eth1which doesn't seem to matter where its placed but I put it before the line containingiface eth1 inet dhcpjust to be safe (and consistent).
- Finally, restart the network like this:
/etc/init.d/networking restart. You can check if you get an IP address from the access point by usingifconfig (root access!).
You can troubleshoot just the wireless authentication part with the following command (root access!):
/sbin/wpa_supplicant -i eth1 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf
As you can see, replace eth1 with your wireless network device and wext with the driver that works for you. The /var/run/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf is the config file you created earlier. You should see something like this if everything works well:
Trying to associate with 00:16:01:ad:88:71 (SSID='[YOUR SSID HERE]' freq=0 MHz)
Associated with 00:16:01:ad:88:71
WPA: Key negotiation completed with 00:16:01:ad:88:71 [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:16:01:ad:88:71 completed (auth)
[id=0 id_str=]
If you don't get the message above, please run iwconfig and see if your wireless network interface is already associated with any of the access points. If not, you need to set it explicitly with iwconfig eth1 essid [YOUR SSID HERE] and try running the wpa_supplicant again.
If something breaks, just go back to edit your config file and retry until it works.
Hope that helps people out there with similar configs! ![]()
Update: /var/run is a bad place to put config files as it will clear the stuff there on each restart. I should have realised this earlier!
. Also added additional info about setting the ssid before running wpa_supplicant.
Working Remotely
By Chee Ming on Apr 21, 2007 | In Technical, Exoweb, Ubuntu, Mac OSX | Send feedback »
For the month in March, I've been mostly away from the office because I was in Tallinn, Estonia on business. Due to that, I've experienced working remotely a.k.a telecommuting. Its not as nice as being in the office with dual monitors, free soft drinks, familiar people around and etc but its pretty much the same, in terms of getting the work done, as long as you have a good Internet broadband connection and the right tools setup.
I've tried working remotely on a MacBook running OSX, Thinkpad running Windows and finally my own Dell Inspiron also running Windows. I would say that the MacBook gave me the most pleasant user experience, but overall it was pretty much the same. This was due to the fact that most of the work I was doing involved the command line and editing text with Vim.
For any *nix type of environment, having ssh was good enough, since everything else was already on the machine that you are connecting to. But when I was in Estonia, the connection back to China would be a tad too slow to do that. So for the MacBook, I was using Parallels to setup a Debian virtual machine for my development work. Due to the new Intel dual core chips, the virtual machine was running smoothly.
The other applications that I used on the OSX were Firefox, Thunderbird, Adium (for MSN), Colloquy (for IRC).
When I switched to the Thinkpad, due to dead hard disk on the MacBook, I had the problem of not having all the small but powerful command-line tools that were easily available on the *nix environment; I am so dependent on find, grep, awk, head, tail and less. I used Parallels to run a Debian virtual machine. Since I had Debian, that solve the problem of not having those tools on the native operating system. On Windows, I was also using Firefox, Thunderbird and Gaim, but now its know as Pidgin (for MSN & IRC). The Thinkpad was pretty speedy, so no problems running the virtual machine. Actually, I think it wasn't that fast until I shutdown and disabled about 15 small little programs, that came with the standard install. Not sure what most of them do, but they sure take up a lot of memory and CPU, to the point that Windows wasn't shutting down properly. Once that was done, I could even use the hibernate feature and it worked almost as well as the OSX's Sleep.
My Dell Inspiron is a bit too old for this virtual machine business and since I was using it mainly at home I didn't need to setup a full development environment for it. I could dual-boot and setup something on Ubuntu with chroot. But anyway, all I needed was a ssh clone in Windows. So I found PuTTY. Putty also supports ssh-agent features with Pagent, but it needs to use a different ssh key format, which can be converted using PuTTYgen.
So thats a recap of my experience when working remotely. I found it surprisingly easy. Not much reconfiguration, although mostly with Vim, since I am pretty used to the defaults. Of course I had to install Debian, but a stock install was good enough and I could get it up and running pretty quickly and for those software packages that weren't in stock install, apt-get would work well. And last but not least, all that comes without a fee and most of them will give you the freedom to modify it in whatever way you want. Absolutely cool!
How would working remotely differ if you are using Microsoft Visual Studio and suddenly your machine crashed and burned? What was your experience like? And how about other GUI-based tools, like Eclipse?
