Debian This forum is for the discussion of Debian Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-23-2012, 06:29 PM
|
#1
|
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Rep: 
|
Two strange samba sharing problems
Hi. I apologize my bad english. Hope you understand. I have raspberry pi with debian wheezy.
My first problem is: (THIS PROBLEM SOLVED. To see how, look down)
Samba user seems like to be "other" user. I have done system user with adduser and samba user smbpasswd. Then chmod 775 /home/basso. Then i checked ls -ld /home/basso and i got drwxrwxrwx 2 root Share 4096.
Then i make connection in windows7 and i am able to login there and read files but not write. When i change chmod 777 /home/basso, i am able to write also. So seems like it works because i must use name/password in login but i cant write without chmod 777. Something strange happens here.
Some of my samba share config:
Security = user
workgroup = WORKGROUP (windows too)
encrypt passwords = yes
unix password sync = yes
map to guest = bad user
usershare allow guests = yes
[homes]
comment = Home Directories
browseable = no
create mask = 0775
directory mask = 0775
valid users = %S
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[basso]
path = /home/basso
valid users = Basso
read only = no
browseable = no
public = no
writeable = yes
guest ok = no
writeable = yes
guest ok = no
I paste my testparm too:
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[basso]"
Processing section "[usb]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
server string = %h server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb
[homes]
comment = Home Directories
valid users = %S
read only = No
create mask = 0775
directory mask = 0775
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
print ok = Yes
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
[basso]
path = /home/basso
valid users = Basso
read only = No
browseable = No
[usb]
path = /mnt/disk2
valid users = Basso
read only = No
create mask = 0777
directory mask = 0777
guest ok = Yes
My second problem is usb stick write enabling. I have usb memory which is FAT32. There problem is that i can read and execute but not write at all. chmod not even change anything. i wrote chmod 777 /mnt/disk2 and ls -ld /mnt/disk2 says drwxr-xr-x 2 root root 4096 tammi 1 1970 /mnt/disk2
I hope someone knows what the hell i am doing wrong. Thanks!
Edit: With chmod 777 i can do all. With 775 i can read and 771-774 and 776 i can't even log in
Edit: First problem solved. I did groups and added users to groups. Then force group to smb.conf. I also used
sudo groupadd group1
sudo usermod -G group1 Basso
sudo chown -R root:group1 /home/basso
sudo chmod -R 770 /home/basso
Now i can set "others" to 0 and that is enough. Usb problem not solved yet
Edit: Now both problems solved. I did the same thing to usb disk. It blocked me to chance /mnt/disk2 permissions. Don't know why. So i did disk1 and used sudo chown -R root:group1 /mnt/disk1 and sudo chmod -R 770 /mnt/disk1 and now it is working. And now my usb share looks like this:
[usb]
path = /mnt/disk1
valid users = Basso
read only = no
browseable = yes
public = no
writeable = yes
guest ok = no
force group = group1
PROBLEM SOLVED.
Last edited by Basso84; 11-24-2012 at 04:40 PM.
Reason: Both problems solved
|
|
|
|
11-25-2012, 09:41 PM
|
#2
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You can't change permissions on a FAT32 filesystem. Instead use mount options to set the owner and permissions when it is mounted. You don't need to change permissions of the device. Use the UUID=<uuid> for the device name in /etc/fstab because the particular device (e.g. /dev/sdb1) could change for a removable drive.
Check /etc/passwd and your smbpasswd command. Don't use Basso if your user name is basso. It looks like you are granting others permissions instead to gain write access. Resort to the samba logs when troubleshooting.
|
|
|
|
11-26-2012, 07:02 AM
|
#3
|
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Original Poster
Rep: 
|
Quote:
Originally Posted by jschiwal
You can't change permissions on a FAT32 filesystem. Instead use mount options to set the owner and permissions when it is mounted. You don't need to change permissions of the device. Use the UUID=<uuid> for the device name in /etc/fstab because the particular device (e.g. /dev/sdb1) could change for a removable drive.
Check /etc/passwd and your smbpasswd command. Don't use Basso if your user name is basso. It looks like you are granting others permissions instead to gain write access. Resort to the samba logs when troubleshooting.
|
Actually i noticed same thing. Usb stick showed 14Gb which is my SD card. Then i did actually that thing which you adviced and now my 4Gb usb stick is in use. But i used this command: sudo mount -t vfat -o rw,users /dev/sda1 /mnt/disk1 but i don't know yet how to put this tu fstab. I need use that command everytime i boot my debian. Can you tell me hot to do this?
And my username is Basso, home folder is basso and usb share is disk1
Thanks!
|
|
|
|
11-29-2012, 07:59 AM
|
#4
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Assuming the UUID of the USB stick's file system is 866E-E1E1
Code:
UUID=866E-E1E1 /mnt/disk vfat rw,nosuid,nodev,uid=Basso,gid=Basso,dmask=0077,fmask=0177,utf8=1,noauto,flush,noatime 0 0
I assumed Basso is your default group for gid=. nosuid and nodev are for security on mass storage devices. Consider no exec option as well. No auto is needed to prevent booting failure is the USB stick isn't plugged in. You could use nofail instead. The 'owner's option will let you mount the pen drive without needing to use sudo.
With these permissions, only user Basso can read files on the pen drive on that computer.
I used the uuid number, so it will boot even if a different device node is used the next time.
|
|
|
|
11-30-2012, 04:55 AM
|
#5
|
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Original Poster
Rep: 
|
Thanks for code but there is problem. With that code usb stick shows at 14Gb. Real size is 4Gb. With this code with manual use sudo mount -t vfat -o rw,users /dev/sda1 /mnt/disk1 it works but with your code, size is wrong. Little more info:
User = Basso
Group where Basso belongs = admini
sudo blkid /dev/sda1 tells me = /dev/sda1: UUID="2451-2E60" TYPE="vfat"
And i tried that your code to fstab
Last edited by Basso84; 11-30-2012 at 05:37 AM.
|
|
|
|
12-02-2012, 05:47 AM
|
#6
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
It sounds like the file system is corrupt. You should back up the files on it and reparation and reformat it.
|
|
|
|
12-05-2012, 08:13 AM
|
#7
|
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Original Poster
Rep: 
|
Quote:
Originally Posted by jschiwal
It sounds like the file system is corrupt. You should back up the files on it and reparation and reformat it.
|
Ok. I try that and then do that again and hope it works. Thanks for help!
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:24 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|