NMT:Samba: Difference between revisions

From Lundman Wiki
No edit summary
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Easy. Once Telnet access is enabled
Easy. Once Telnet access is enabled


Edit /etc/samba/lib/smb.conf and add a section
Edit /etc/samba/lib/smb.conf and edit the Share section and simply remove the HARD_DRIVE from the path


           [USB_DRIVE_A]
           [Share]
           path = /opt/sybhttpd/localhost.drives/USB_DRIVE_A-1
           '''path = /opt/sybhttpd/localhost.drives'''
          read only = No
          guest only = Yes
          guest ok = Yes


I did this by simply inserting 'echo' before each line and '>> smb.conf' at the end of each line.
Start and Stop Samba to see the effect, however you may need a reboot.


Stop and start the samba server to see the effect.
You can now mount your USB devices as a network drive in Windows, or share it with your other media streaming devices around the house.
 
If your drive is formatted with a linux extended file system, you may need to adjust your permissions accordingly to allow write access.
 
==Newer versions==
A recent upgrade reveals that this method no longer works, as the smb.conf configuration file is now created dynamically on startup.
 
To fix this, telnet into the box and copy to the /mnt/syb8634/etc/smb.sh file to a download directory and edit the following section as below
 
start() {
        if [ -e /mnt/syb8634/bin/nmt_services.cgi ]; then
                echo Updating samba workgroup...
                smbworkgrp=`pflash get workgroup`
                /mnt/syb8634/bin/nmt_services.cgi cmd=smb_workgrp opt=${smbworkg
        fi
        passwd
        echo 'path = /opt/sybhttpd/localhost.drives' >> /etc/samba/lib/smb.conf
        if [ -e /mnt/syb8634/bin/nmbd ]; then
                if [ -e /mnt/syb8634/bin/smbd ]; then
                        echo -n "Starting samba"
                /mnt/syb8634/bin/nmbd -D
                        /mnt/syb8634/bin/smbd -D
                fi
        fi
}

Latest revision as of 16:26, 27 November 2010

Easy. Once Telnet access is enabled

Edit /etc/samba/lib/smb.conf and edit the Share section and simply remove the HARD_DRIVE from the path

         [Share]
         path = /opt/sybhttpd/localhost.drives

Start and Stop Samba to see the effect, however you may need a reboot.

You can now mount your USB devices as a network drive in Windows, or share it with your other media streaming devices around the house.

If your drive is formatted with a linux extended file system, you may need to adjust your permissions accordingly to allow write access.

Newer versions

A recent upgrade reveals that this method no longer works, as the smb.conf configuration file is now created dynamically on startup.

To fix this, telnet into the box and copy to the /mnt/syb8634/etc/smb.sh file to a download directory and edit the following section as below

start() {
       if [ -e /mnt/syb8634/bin/nmt_services.cgi ]; then
               echo Updating samba workgroup...
               smbworkgrp=`pflash get workgroup`
               /mnt/syb8634/bin/nmt_services.cgi cmd=smb_workgrp opt=${smbworkg
       fi
       passwd
       echo 'path = /opt/sybhttpd/localhost.drives' >> /etc/samba/lib/smb.conf
       if [ -e /mnt/syb8634/bin/nmbd ]; then
               if [ -e /mnt/syb8634/bin/smbd ]; then
                       echo -n "Starting samba"
               /mnt/syb8634/bin/nmbd -D
                       /mnt/syb8634/bin/smbd -D
               fi
       fi
}