LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can cant setup persmssion to write to my samba share folder from win7 machine (https://www.linuxquestions.org/questions/linux-newbie-8/can-cant-setup-persmssion-to-write-to-my-samba-share-folder-from-win7-machine-4175431887/)

skinney 10-12-2012 12:58 PM

can cant setup persmssion to write to my samba share folder from win7 machine
 
totally new to linux btw
i set up samba per this...
https://help.ubuntu.com/11.04/server...ileserver.html
i can browse the folder from my win7 machine but i cant move files to it or edit the files in samba/share from win machine
i want to move all my media files from my win7 machine to my ubuntu server
what am i doing wrong?

JaseP 10-12-2012 04:13 PM

See this thread on the fedora forums:
http://forums.fedoraforum.org/showthread.php?t=267377
It should apply to Ubuntu as well...

skinney 10-12-2012 06:58 PM

ah, thanks!
so i'm reading up on SELinux and "samba_export_all_rw"
i believe the stuff i'm reading is assuming the reader knows more about linux that i do

do i add "samba_export_all_rw" into smb.conf or what?
do you know?

I'm not sure tha ubuntu has selinux

JaseP 10-12-2012 07:05 PM

My manual edits to the samba.conf have been less involved. I don't run Microsoft at home...

Did you download the sample samba.conf file, and look at that?

skinney 10-12-2012 09:08 PM

yeah, it has a section of notes at the top on SELinux which my conf file doesn't have
when i add the line
setsebool -P samba_export_all_rw on
testparm says it's ignorning the badly formed line

# Use the samba_export_all_ro or samba_export_all_rw Boolean to share system
# directories. To share such directories and only allow read-only permissions:
# setsebool -P samba_export_all_ro on
# To share such directories and allow read and write permissions:
# setsebool -P samba_export_all_rw on

skinney 10-13-2012 01:48 AM

found this in another forum
'chmod 777 [Foldername] -R'
worked!!

I'm researching what chmod 777 is and i see peeps saying things like...
it a bit of a security risk, if you have to use it authentication are not properly configured, you can create folders but cant delete them (i havent tried yet i'm just moving files right now)

i'll do a post about this command

croog 10-14-2012 03:32 AM

Quote:

Originally Posted by skinney (Post 4804341)
do i add "samba_export_all_rw" into smb.conf or what?
do you know?

No.
"setsebool -P samba_export_all_rw on" is a command that needs to be run as root if you are having selinux/samba conflicts. on my machine selinux usually tells me of any conflicts and suggests solutions.


In your position I would create a group for all users that I want to have access to the shared directory
assign those users to the new group
change ownership of the shared files to the group
set permissions to allow the owner and group read/write access.

as root run the commands

groupadd [group]
usermod -a -G [group] [user]
chgrp -R [group] [foldername]
chmod -R 660 [foldername]

chmod -R 660 changes the permissions of [foldername] and all its subdirectories to read/write for owner and group. This is good unless you want to run programs out of the folder then use chmod -R 770 [foldername]

*remember that any for samba user you want to add to the group you need to use the unix(linux) user name not the Windows one(these could be the same).

You can add a new user to a group with 'useradd'
you can change the owner of the files with 'chown'

As for chmod permissions take a look at this chart it should make them quite clear http://www.draac.com/chmodchart.html

running '[command] --help' in the terminal(console) should tell you how to use that command but if you need more info you can type 'man [command]' into the terminal and it should give you detailed info on how to use it.

From my experience be careful when running commands as root, small typos can cause big headaches.

Good luck

skinney 10-14-2012 08:17 PM

I will do this!
this answers many questions
thank you!

skinney 10-14-2012 09:19 PM

ok i've done what you said and i've lost all access to the folder from win7 machine
but if i chmod 777 i get it back
if i chmod 770 i lose it again
so this i'm getting in only via "world" not user or group right?
hmm
also, if i create or modify unix users do i need to add them to samba?

skinney 10-16-2012 11:35 AM

i have reinstalled ubuntu server on my 8 gig flashdrive and permissions seem to be working better

croog 10-16-2012 07:41 PM

Quote:

so this i'm getting in only via "world" not user or group right?
yes
Quote:

also, if i create or modify unix users do i need to add them to samba?
Only for each user you want to connect via samba to your server.

You may be able to make all the windows users share the same unix user, but i'm not sure. I just make all the computers connect as the same samba user.

I use the Samba Server Configuration Tool to manage my samba users, but I prefer to edit smb.conf manually to configure my server and shared folders. If you have the tool or get it, just go to Prefrences->Samba Users there you can add/remove samba users and assign them to unix accounts.

skinney 10-16-2012 11:10 PM

i dont have GUI. i'm using ubuntu server. i can use webmin but for some reason samba doesn't show up under servers in webmin
i'm trying to use the terminal anyway. feel like i'll learn more that way

croog 10-17-2012 07:03 PM

I found the file that samba uses to link unix users to samba users. Its smbusers and should be in the same location as your smb.conf. The syntax is strait forward:

# Unix_name = SMB_name1 SMB_name2 ...

The assignment of the samba user might be wrong and cause the loss of access after chmod 770.
Quote:

Originally Posted by skinney (Post 4807787)
i dont have GUI. i'm using ubuntu server. i can use webmin but for some reason samba doesn't show up under servers in webmin
i'm trying to use the terminal anyway. feel like i'll learn more that way

No GUI is why I made my file server a linux box. I did install a GUI for maintenance purposes but it ran default to run level 3. On fedora this does not load X and boots to a console. After the initial set up I rarely ran a GUI on it.

I know nothing about webmin and you should search or start a new thread if you have problems with it

skinney 10-17-2012 07:57 PM

my samba folder doesn't have that file
maybe i should create it?
/etc/samba/ has 3 files... dhcp.conf, gdbcommands and smb.conf

I'm not real worried about webmin

croog 10-17-2012 09:02 PM

A comment at http://www.howtogeek.com/howto/ubunt...ser-on-ubuntu/ says
Quote:

One small detail to note is that /etc/samba/smbusers file did not exist on my system (feisty fawn). However, just creating the file is the designated directory was all I had to do.


All times are GMT -5. The time now is 04:53 PM.