Samba over non-USB

From OESF

(Difference between revisions)
Jump to: navigation, search
Current revision (17:59, 24 November 2006) (edit) (undo)
(revert to remove spam)
 

(2 intermediate revisions not shown.)

Line 47:

Line 47:

or
or
mount -t smbfs //zaurus/home /mnt/zaurus
mount -t smbfs //zaurus/home /mnt/zaurus
 +
 +
[[Category:Network Applications]]

Current revision

The Sharp SL-5500 3.x ROMs and all the later Zaurus models come with Samba builtin. [Samba] lets you share part of the Zaurus' filesystem with a Windows PC or any other Samba enabled OS (like Linux) as if it was a network drive.

By default the Sharp ROMs only come setup to use Samba over the cradle's USB connection. This howto tells you how to edit the Samba setup so that it will work over any network connection, including !WiFi and Bluetooth.

The Samba website (http://www.samba.org) has some excellent documentation which may be useful if you want to tweak your Samba setup further.

The steps below are what you need to follow to enable Samba over any TCP/IP network connection:

  • Run the following commands as the 'root' user (Type 'su' and then RETURN to switch to the 'root' user). Press RETURN at the end of each line:
cd /etc/rc.d/init.d
mv samba samba.bak
echo "netbios-ssn stream tcp nowait root /usr/sbin/tcpd /usr/sbin/smbd" >> /etc/inetd.conf
echo "netbios-ns dgram udp wait root /usr/sbin/tcpd /usr/sbin/nmbd" >> /etc/inetd.conf
/etc/rc.d/init.d/inet restart
  • For the next step you need to be familiar with the editor 'vi' or install a more user friendly editor such as pico or nano. With the editor of your choice, open the file /usr/lib/samba/smb.conf and make the following changes:
    • Change the 'workgroup' setting (The bit after "workgroup = ") so that it matches the workgroup setting on your PC.
    • Insert a new line after the 'workgroup' setting and enter the text "netbios name = " followed by the name which you want your Zaurus to be known. So you should end up with something like "netbios name = zaurus" on a line of its own.
    • For the 'interfaces' setting, you need to add the network interfaces over which you wish to use Samba. Multiple interfaces can be entered, which must be separated by spaces.

For ethernet or !WiFi connections, the interface name will probably be "eth0". For PPP connections over Bluetooth, the interface name would probably be "ppp0" and for PAN Bluetooth connections, the interface name would probably be "bnep0".

NOTE: If you ever connect to a public network (including the internet) using the same network devices, you probably want to restrict who can connect by reducing the range of the IP address to either one or two IP addresses or a private non-routable subnet. Otherwise, making these changes could potentially allow anyone access your Samba shares.

For just one or two IP addresses, insert a new line and enter "hosts allow = " followed by a list of IP addresses separated by spaces.

For a whole subnet, instead of entering something like "eth0" as an interface for the 'interface' setting, enter an IP subnet, e.g. 192.168.129.0/24 which allows IP addresses 192.168.129.0 through to 192.168.129.255 to access your Zaurus' Samba share.

So an insecure 'interface' setting could look something like "interfaces = usb0 eth0" and a more secure setting could look something like "interfaces = 192.168.129.0/24". An 'interface' setting with just "usb0" is quite secure because that only allows access through the USB cradle which only supplies a non-routable IP address to your Zaurus so it cannot be seen on the internet.

To speed up file transfers to your Zaurus you might also want to comment out the settings 'strict sync' and 'sync always' by putting a "#" at the start of the lines with those settings. If you experience any instability however you will have to remove the "#" from the start of those lines.

  • Finally run the following command as root to ensure Samba is shut down in order for these changes to take effect:
/etc/rc.d/init.d/samba.bak stop

Now you should be able to access your Zaurus from windows by entering the following in the Start->Run box (the IP address assigned to your Zaurus may differ):

\\192.168.129.201\home

If Netbios is working properly, you might even be able to enter the following in the Start-Run box:

\\zaurus\home

...where "zaurus" is what you put in the 'netbios name' setting in the samba.conf file. Then you do not need to worry about the IP address and can have it dynamically assigned.

On Linux you would run the following commands to access your Zaurus Samba share, which may or may not require admin access:

mkdir /mnt/zaurus
mount -t smbfs //192.168.129.201/home /mnt/zaurus

or

mount -t smbfs //zaurus/home /mnt/zaurus
Personal tools