DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-05-18 15:03:27

sarvesh29
Member
Registered: 2011-05-03
Posts: 23

Restrict access

I want to know if i can prevent another computer on the network to see a particular folder? because even if i restrict the computer to read only, it will "see" the folders.

Offline

 

#2 2011-05-18 23:17:18

BobE
Member
From: NJ, USA
Registered: 2007-03-24
Posts: 21

Re: Restrict access

Do you mean via the shares?  If so, Samba has an option (browsable=no) which will make the share not visible, meaning it is not advertised.  You have to know the share name and that it exists in order to connect.  For example:

Code:

[ comedy ]
comment = Mature Comedy
path = /mnt/HD_a2/shares/audio/comedy
browsable = no
guest ok = no
valid users = user1, user2
writable = yes

Prevents this share (folder) from being seen, restricts user access to only two people (user1 & user2) and grants them read/write privileges.  I hope this helps you.

Last edited by BobE (2011-05-18 23:17:55)


• DNS-323 A1 | FW1.09 | 2x WD20EVDS AV-GP 2TB SATA 3.0Gb/s 7200RPM, 32MB | RAID1 | ext3 | ffp 0.5,  Samba 3.4.6-1

• NSA-220+ | FW3.23 | 2x WD15EADS “Green” 1.5TB SATA 3.0Gb/s 7200RPM, 32MB | RAID1 | ext3 | External USB: Kingston DT1 2GB Flash Drive ( ffp 0.5 )

Offline

 

#3 2011-05-19 17:46:53

sarvesh29
Member
Registered: 2011-05-03
Posts: 23

Re: Restrict access

Yes this helps me. Thanks a lot.but how do i configure this samba option? by ssh into the dns or the gui has this option somewhere?

Offline

 

#4 2011-05-23 23:53:05

BobE
Member
From: NJ, USA
Registered: 2007-03-24
Posts: 21

Re: Restrict access

I did it by ssh into the box, copied the smb.conf file so I could make my changes, and then copied it back.
( Updated my fun_plug.local too, as seen below. )

Code:

#  Ensure good copy of conf file exists
#  Terminate firmware version
cp /mnt/HD_a2/smb.conf /ffp/etc/samba/private/smb.conf
echo 'Stopping firmware Samba...'
/usr/bin/smb stop
sleep 3
killall smbd
killall nmbd
sleep 3

Because I am using an updated version Samba which gets started later, I killed the firmware version which was running.  If you're going to simply use the version supplied by DLink, then this should work for you:

Code:

#   Ensure good copy of conf file exists
cp /mnt/HD_a2/smb.conf /etc/samba/smb.conf
cp /etc/samba/smb.conf /etc/samba/smb.default
echo 'Restarting firmware Samba...'
/usr/bin/smb restart

I probably didn't need to do the copy to the /ffp directory since that is a link to /mnt/HD_a2/ffp and hence will not get overridden by the firmware when a reboot happens, but I wanted to ensure I always had a fresh good copy to use.
Good Luck!


• DNS-323 A1 | FW1.09 | 2x WD20EVDS AV-GP 2TB SATA 3.0Gb/s 7200RPM, 32MB | RAID1 | ext3 | ffp 0.5,  Samba 3.4.6-1

• NSA-220+ | FW3.23 | 2x WD15EADS “Green” 1.5TB SATA 3.0Gb/s 7200RPM, 32MB | RAID1 | ext3 | External USB: Kingston DT1 2GB Flash Drive ( ffp 0.5 )

Offline

 

#5 2011-05-25 18:49:39

sarvesh29
Member
Registered: 2011-05-03
Posts: 23

Re: Restrict access

i get this : cp: cannot stat '/mnt/HD_a2/smb.conf': No such file or directory

How do i find if a good copy exists? I did a search on the NAS to try finding it but i guess i am not on the right path.

Offline

 

#6 2011-05-25 21:00:44

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: Restrict access

The default smb.conf is in /etc/samba

Personally, I placed my edited version of smb.conf in /ffp/etc/samba, then on bootup I perform the copy and restart. The location makes little difference as long as it is on the disk somewhere.

Steps:

Copy the original /etc/samba/smb.conf to another location
Edit this file to make the changes you want
Edit /ffp/etc/fun_plug.local to copy the modified file and restart samba

Similar to the BobE, here are the lines I use in fun_plug.local. I add a check to ensure the modification exists. It isn't really required, but I use the same scripts on different DNS323s and one need the modification, the other does not.

Code:

# Replace the smb.conf file with one that enables symbolic link parsing
if [ -f /ffp/etc/samba/smb.conf ]; then
  echo "Making a backup of /etc/samba/smb.conf"
  mv /etc/samba/smb.conf /etc/samba/smb.original.conf
  echo "Copying /ffp/etc/samba/smb.conf to /etc/samba/smb.conf"
  cp /ffp/etc/samba/smb.conf /etc/samba/smb.conf
  echo "Restarting Samba services"
  /usr/bin/smb restart
else
  echo "Skipping Samba reconfiguration"
fi

Last edited by FunFiler (2011-05-25 21:27:23)


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

#7 2011-05-28 18:38:51

sarvesh29
Member
Registered: 2011-05-03
Posts: 23

Re: Restrict access

All right, it cannot find the default samba.
if i go your way and put edited version of smb.conf in /ffp/etc/samba
where do i get the smb.conf to copy it to that folder?

Offline

 

#8 2011-05-29 00:31:54

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: Restrict access

You can use this as a starting point. Edit as required.


Attachments:
Attachment Icon smb.original.conf, Size: 1,440 bytes, Downloads: 314

3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB