Installing Samba on your pogoplug

I know there are a bunch of articles online about installing samba on Pogoplug (or openpogo enabled) devices. I read quite a few of them and still ran into trouble installing it on my appliance so I though I’d do a quick write-up of how I got things rolling.

First, you need to install the OpenPogo base package. Very detailed and effective directions are available here.  A couple of notes about OpenPogo before you go running off though. First, it requires an external USB drive to install on, and run from. Second, if you remove the USB drive (perhaps mistakenly thinking you were done with it) the filesystem that was on there is dismounted and everything running from it stops. And finally, the USB stick will have to be reformatted into a linux ext2 or ext3 format which means you’ll lose any existing data on it. Best to find an older 1GB stick and use that for this as the packages seem rather small.

Ok, so once you’ve installed the OpenPogo software onto your external USB drive, rebooted, mounted, etc, what you’ll need to do is run ipkg to install Samba. You should be able to execute this command to kick it off:

-bash-3.2# ipkg install samba2

This kicks off the download and installation process which I imagine under ideal circumstances should take care of the whole thing for you. If it did, skip this section and see the configuration part below. I’ll warn you though, the downloads were very slow for me, took about twenty minutes to download the seven meg file even though I was able to wget it to my linux box much faster.

The problem I had was an invalid MD5 checksum when using the automatic installer, so I resorted to manually downloading the file, then installing it.

-bash-3.2# cd /root
-bash-3.2# mount -o rw,remount /
-bash-3.2# ipkg download samba2
-bash-3.2# ipkg install samba2_2.2.12-2_arm.ipk

Once the install has completed successfully, you should turn on the server by running this command:

-bash-3.2# /opt/etc/init.d/S80samba start

After which you can verify that the server is running by checking the output of netstat

-bash-3.2# netstat -an | grep ":13[7-9]"
tcp 0 0* LISTEN
udp 0 0*
udp 0 0*
udp 0 0*
udp 0 0*
udp 0 0*
udp 0 0*

Now to verify that samba is working properly, execute this smbclient command:

-bash-3.2# smbclient -L localhost -N
added interface ip= bcast= nmask=
added interface ip= bcast= nmask=
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 2.2.12]

The output is a bit more verbose if you have shares active, and other active workgroups, so I snipped them out of this example. Now we need users! Execute these commands to create a user account on the system:

-bash-3.2# adduser -H User1
-bash-3.2# adduser -H User2

Now run these commands to setup a samba user:

-bash-3.2# smbpasswd -a User1
-bash-3.2# smbpasswd -a User2

Now comes the part of defining the drive mappings. There are a couple of ways to map things out, you can separate each physical disk into a share, or share all disks under one. Just depends on what your requirements are.

For the first method, separating each disk into it’s own share, this is what you need to know:

By default, the external USB drives are mounted in /tmp/.cemnt/sdX1 where X is usually ‘a’ for the first disk, ‘b’ for the second disk, etc. You can look to see how yours are mounted by running the df command:

-bash-3.2# df -h
Filesystem Size Used Available Use% Mounted on
/dev/mtdblock2 32.0M 18.6M 13.4M 58% /
none 125.0M 8.0k 125.0M 0% /tmp
/dev/sdd1 944.6M 57.8M 838.8M 6% /tmp/mnt_opt
/tmp/.cemnt/sda1 465.6G 365.0G 100.7G 78% /tmp/.cemnt/mnt_sda1
/tmp/.cemnt/sdb1 74.5G 53.5G 21.1G 72% /tmp/.cemnt/mnt_sdb1
/tmp/.cemnt/sdc1 149.0G 75.3G 73.7G 51% /tmp/.cemnt/mnt_sdc1
/tmp/.cemnt/sdd1 944.6M 57.8M 838.8M 6% /tmp/.cemnt/mnt_sdd1

As you can see above, we have four external USB drives mounted. /dev/sdd1 is the external USB thumb drive that OpenPogo is installed on, and mounted to the /opt directory. sda1, sdb1 and sdc1 are all external USB drives with user data on them. Make a note of which disk is which, you should be able to tell by the disk size, or at least content.

Next we need to modify the samba configuration file. It should be located in /opt/etc/samba/smb.conf. Using a text editor such as vi or nano, edit this file and add the following text — this part is the global configuration:

#smb.conf begin
# Global Parameters
workgroup = WORKGROUP
netbios name = Samba
log file = /opt/var/log/samba/log.%m
null passwords = yes
guest account = root
security = share
max log size = 50
encrypt passwords = yes

NOTE: If you’re connecting to these shares from a Windows machine, you may need to set encrypt passwords = no in the above example. I’ve seen mixed results for that.

Now, if you chose to define each drive as it’s own share, you could add something like this to the config file. The text within the [] brackets is the name of the share:

path = /tmp/.cemnt/mnt_sda1/
browseable = yes
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes

The path - /tmp/.cemnt/mnt_sda1/ is the path to the first external drive. Keep in mind that this configuration has NO SECURITY other than that of your local area network. If you need per user security you will need to modify these directives.

Now, your other option is to share out ALL external disks under on mapping. To do this, use this configuration:

comment = Pogoplug USB disks
path = /tmp/.cemnt
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes

Keep in mind that this configuration has NO SECURITY other than that of your local area network. If you need per user security you will need to modify these directives.

Anytime that the samba configuration file has been modified, you must restart the service for the changes to take effect. Do that with a restart command:

-bash-3.2# /opt/etc/init.d/S80samba restart
Stopping smbd:
Stopping nmbd:
Starting smbd:
Starting nmbd:

Now that you’ve completed the configuration and restarted the service you should be able to connect to your pogoplug device directly, upload, download, delete and modify files. I must stress again that this is a very OPEN configuration for samba. If you require additional security for the shares (like on a corporate network) then you should really know more about samba configuration. If anyone wants to post some examples of securing the directories/disks using the accounts created in the beginning please do — I’m no samba expert.

Happy Networking!

New gadget: Pogoplug

After reading some reviews on Engadget and Gizmodo I broke down and purchased a PogoPlug from (they were on special for $47.99 at the time, $79 at the time of this writing).

Pogoplug is an appliance that you can connect to your home network which runs a custom version of linux. The device has a gigabit ethernet port, three USB 2.0 ports on the back and one on the front. Basically, you plug your external USB hard-drives into this thing and it makes your files available to you no matter where you roam.

Best part (for home users) is that there are no firewall rules that need to be put on your home router or custom firewall. The device heartbeats out to their servers in the cloud and make the whole thing possible without a lick of configuration being required. Caveat: UDP has to be unfiltered outbound for this to work, so “real” firewalls may have to have allow statements put in them.

So, with your purchase of the hardware, you get lifetime support and access to your personal “storage in the cloud”. This can be accomplished remotely (or locally) via the web client or samba/windows shares. You also have the option to share files and folders with the world, individual users, etc. There’s even a client that runs on the Mac, PC and iPhone to access files directly and see them as locally mounted drives. If you happen to be on the same network your connections go directly to the device and not through the Pogoplug servers.

From my iPhone, I’ve been able to stream movies over WiFI and 3G with great quality. The Pogoplug device will convert audio and video files on the fly to allow streaming to the iPhone/iPod/iPad/PC/Mac, etc. Sweet little deal, if you happen to have a bunch of movies or music on your external drive(s).

Through the use of OpenPogo you can even install custom software on the appliance like samba, squid, bittorrent, a webserver, etc! Since this little guy runs on linux, the possibilities are endless really.

Been using this for a couple of weeks now, and I’m really impressed. The company announced just a few days ago that a new firmware update would allow for printing through the device, and is being rolled out now to customers. This thing is becoming very versatile!

More later.

And Netflix/iPhone arrives!

Just yesterday Netflix released their much awaited iPhone app (or I should say, Apple approved and published their app to the iTunes store). So far I’m pretty impressed with it.

The application allows you to obviously browse your instant queue, watch whatever you like and resume where you left off should you change directions on them. One thing I was surprised to see when I first logged into the application was that I was using all six of my licenses. Very much akin to the iTunes “authorized computers” schema. I was directed to their website where I had the option to kill devices, some of which I had not streamed on in quite some time. The message on that screen said that devices can be added and removed pretty much at will, so no big deal there.

So, back to the app. The video quality is very good, comparable to a downloaded movie from the store (or one you ripped). WiFI was very fast obviously, but 3G wasn’t really too far behind it, took a few moments to load and buffer, but solid after that.

I’m really glad I stuck with my grandfathered unlimited data plan with AT&T, I could see how getting an application like this approved would benefit them greatly financially as users on a limited data plan burn through their megabytes and gigabytes without a second thought. Careful out there, oh limited bandwidth users. Everyone else, burn it up! Cheers.

Uh, isn’t summer almost over? What’s the deal Netflix?

Back in June, movie rental giant Netflix promised an iPhone app this summer. So far, no app, no word. So, what’s the deal, summer is certainly coming to an end, and very soon. Apparently, in addition to not monitoring their official blog for spam, they’re also not commenting on the status of their iPhone app. Is it coming, or isn’t it?

Fun with geek tool

Thanks again to LifeHacker, I’ve been playing around with Geek Tool. It’s a tool for OS X that can do a bunch of things, I’m using it to create some desktop widget type things. I got the code to display the current weather conditions from this post and decided to play around with adding some additional code.

So after mucking around with the graphical interface and figuring a few things out (which really isn’t difficult to do) I came up with a little routine that checks latency to the inside interface on my firewall. It’s really nothing special but I kind of like seeing it up there.

You can paste this into the command window in Geek Tool or put it in a file and call it as a shell script. Here’s the code (replace YOURIP with your real IP address obviously). You may need to modify the script slightly if your ping output isn’t the same as what I’m using.

ping -c 1 YOURIP | grep -i icmp_seq | sed -e 's/64 bytes from YOURIP: icmp_seq=0 ttl=64 time=/Wireless lag: /'

I set the refresh rate for 60 seconds and have the status feedback image enabled, if the little green bubble turns red then it’s skipped a beat. I found a bunch of other really useful posts about scripting too, here’s a couple to get you started if you’re interested:

Evaluating personal VPN solutions

I’ve been doing a lot of reading online, trying to find which personal VPN service would be best for me to use. The concept of using a non-work VPN is a little foreign to me, but now that I’m finding myself connecting more and more to the internet away from home and through public wifi access points (or wireless at work) I though it might be high time to invest in a little security.

Right now I’m evaluating (and by evaluating I mean I paid for a month of access) VPN services by the folks over at HideMyAss. Now, for the record, I hate the name and think they should call their professional VPN services by another name, but I guess what really matters is how the service functions.

So, for about $12/month (less if you pay for a longer subscription) you get to choose from 28 different VPN endpoints in nine different countries. Pretty handy I suppose if you’re in the UK and wanted to watch video that is restricted by region to the US. Not what I need it for, but the functionality exists.

I’m a Mac user and installation was really easy, even though I’m running an older operating system (10.4.11). They  have a client you can use that autoconfigures, or you can use PPTP VPN tunneling built into the OS and be up and running in minutes.

So far, so good. Speeds are really good. I can’t really see any notable difference in my connection speed while connected or disconnected. I’ll continue to play with it for a while, but will still be looking around for more options.

So, what say you, got some experiences or reviews you’d like to share? Jump in and leave a comment..