[solved ] access a SAMBA network folder

Post here if you are a new Porteus member and you're looking for some help.
User avatar
Posts: 107
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v3.2.2
Location: Romania

[solved ] Re: access a SAMBA network folder

Post#46 by amplatfus » 24 Jun 2013, 15:53


I have good news :)
I have discovered that the problem have something to do with NTLM authentication.
I use until now the "security = share" but I saw in samba log file that "this is deprecated" so I changed to "security = user "in smb.conf in router.
I have defined jffs user with given rights.
Results: is working in all Porteus distribution, even in latest one (2.1 RC 1). Even curlftpfs is working.

Here, below are the commands I have used for user :

Code: Select all

#Because smbpasswd program build-in DD-WRT always
#treats /etc/samba/smbpasswd as the samba password file,
#and /etc is a readonly file system,
#we must temporary bind /tmp/etc to /etc when adding a user.
#Change # Add user for samba section like below:

# Add user for samba
mount -o bind /tmp/etc /etc
cd /etc
vi passwd

# clear samba user if exists
#echo "" > /tmp/etc/samba/smbpasswd

adduser jffsuser --home /mnt/jffs --shell /bin/false

#right permissions, let's change it (as root, of course): 
chown jffsuser:jffsuser /mnt/jffs

#At the end you should create the password for Samba access.
#It can (and #should) be different from the user system password.
#As this is the first #time we've assign the user a Samba password, you must use -a: 
#set password
smbpasswd -a jffsuser

umount /etc

Test it
Check if user is created in the system:
grep jffs /etc/passwd

#startup script +automount in ddwrt
grep -q jffsuser /etc/passwd || echo 'jffsuser::65534:65534:share:/mnt/jffsuser:/bin/false' >> /etc/passwd

#Porteus KDE 2.1 RC1
modprobe cifs
mkdir /mnt/pc
mount.cifs //192.168.x.x/mnt /mnt/pc -o username=jffs,password=*****

curlftpfs -o allow_other qwerty:pass@some.dyndns.org /ftpmount

#In the [global] section of Samba configuration, update the config value as indicated below:

    #Change this line as you see fit:
    server string = Samba Server
    interfaces = 192.168.x.x/24
    #Change this line as you see fit:
    workgroup = WORKGROUP
    #Change this line as you see fit:
    netbios name = DDWRT
	security = user
#security = SHARE --> DEPRECIATED
	encrypt passwords = Yes
#	passdb backend = smbpasswd
	smb passwd file = /tmp/etc/passwd
	null passwords = no
	guest account = nobody
	invalid users = root
#	time offset = -300
#	time offset = 60
#	lanman auth = No
	wins support = Yes
	socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
#	name resolve order = wins hosts lmhosts bcast 
	log file = /var/samba/sambalog.%m
	max log size = 100
	load printers = No
	dns proxy = No
	hosts allow = 192.168.x  
	remote announce = 192.168.x.255

#	comment = Home Directories
#	valid users = root
#	read only = No
#	browseable = No

	comment = All Printers
	path = /opt/var/spool/samba
	printable = Yes
	browseable = No

	path = /mnt
	valid users = jffs
	read only = No
#	force user = root
	inherit permissions = Yes

	path = /opt
	valid users = jffs
	read only = No
#	force user = root
	inherit permissions = Yes

I have edit rc.local for automount at boot.

Sources used:
http://www.dd-wrt.com/wiki/index.php/Co ... a_in_Linux
http://arouter.blogspot.ro/2011/07/samb ... d-wrt.html

Sursa ftpmount:
http://www.linuxnix.com/2011/03/mount-f ... linux.html


Thank you for great support. I have learned a lot here.
Best regards,
Porteus-v3.2.2 MATE
Kernel: 4.9.12-porteus

Post Reply