DebianThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
[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
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.
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
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.
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"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.