LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   I can not open the user folder in home and write in a shared folder (http://www.linuxquestions.org/questions/linux-general-1/i-can-not-open-the-user-folder-in-home-and-write-in-a-shared-folder-469524/)

jorge_ivan 07-31-2006 07:08 PM

I can not open the user folder in home and write in a shared folder
 
Hi, I installed fedora 5, I created an user named jorge and a shared folder "LAN" with the permissions for this user, but when I want to acces it in win xp with option RUN with the IP of the server (\\xxx.xxx.xxx.xxx) where fedora was installed, I can see the userīs folder "jorge" and the shared folder "LAN", the problem is that when I want to open the userīs folder I can not. I can open The shared folder "LAN" but I can not write it.
Help please....:confused:

JZL240I-U 08-01-2006 01:47 AM

On what file system is your /home/jorge/LAN? You need extra drivers for ext2/3 on WinXP...

gkiagia 08-01-2006 07:42 AM

Quote:

Originally Posted by JZL240I-U
On what file system is your /home/jorge/LAN? You need extra drivers for ext2/3 on WinXP...

Are you sure? I can write on my linux reiserfs partition from winxp using samba and I haven't installed any reiserfs driver.

The problem is with permissions. What I do is login as root from the remote machine so I gain full access to my linux box (What I mean is that when you are trying to access this LAN folder from windows and it asks you username and password, type "root" or "administrator" and give the root password). A more proper solution is to reconfigure samba on your linux box and remove the read-only attribute from LAN. I don't know much about samba, though, so I can't help you more. See the fedora documentation. :p

JZL240I-U 08-01-2006 08:19 AM

Quote:

Originally Posted by gkiagia
Are you sure? I can write on my linux reiserfs partition from winxp using samba and I haven't installed any reiserfs driver.

Ooops. You're right, I forgot about that.

Quote:

Originally Posted by gkiagia
... A more proper solution is to reconfigure samba on your linux box and remove the read-only attribute from LAN. ...

That wouldn't need samba, just issue the chmod command on the linux box for /houme/jorge/LAN or does samba set its own attributes? No, I guess it can't really...

gkiagia 08-01-2006 08:26 AM

Quote:

Originally Posted by JZL240I-U
That wouldn't need samba, just issue the chmod command on the linux box for /houme/jorge/LAN or does samba set its own attributes? No, I guess it can't really...

Yes, samba has it's own attributes as well as its own user accounts. Only the root account seems to be common (at least in my configuration).

JZL240I-U 08-01-2006 08:28 AM

Quote:

Originally Posted by gkiagia
Yes, samba has it's own attributes as well as its own user accounts. Only the root account seems to be common (at least in my configuration).

Huh? Do you know why? What is this feature needed for and how does one duplicate the accounts for entire file systems?

it4soho 08-01-2006 11:28 AM

Samba Permissions
 
:tisk: OK... first of all, Samba does NOT have separate permissions and usernames (what a NIGHTMARE that would be to implement!) Samba DOES (or more corectly, CAN) have a mapping of Windoze permissions to Linux permissions, and also has a username map (so that Linux username 'account123' can be accessed by the Windoze username 'Millie'). If you've enabled it, Samba can even use the Linux ACLs (Access Control Lists -- which let you go beyond the standard User/Group/Other permissions). But when it comes to accessing a file (in a directory that is properly shared), the Linux permissions "rule."

If you are using a Windoze domain or AD server, then Samba can automatically create appropriate usernames using the winbindd daemon (NOTE: winbindd generated names will NOT appear in /etc/passwd, /etc/shadow, or local LDAP user listings, but will appear normally when you use an 'ls -l'! If you don't know how to do this, there are LOTS of Samba HOWTO's to help). If Samba is your Domain Controller, then users have to have an entry in /etc/passwd, /etc/shadow, or LDAP.

Based upon what I've read, however, I'd suspect that the original poster created the user account manually -- which means that the /home/user directory that is being shared in Samba is owned by root, and not the user. As a basic rule of thumb, if the directory shows up on the Windoze client (Windoze XP), but you cannot write to it, then it either has been shared as a read-only share (unlikely to be an accident), or the directory does not have the proper owner/group/permissions settings. The rest of the Samba settings are working if you can see the share from XP!

Just to test my theory, I suggest logging into the Linux server, cd-ing to the shared directory, and then allowing full access (chmod 777 .) [don't forget the dot!] and then trying again from Windoze (fortunately, no reboot necessary -- even for the XP system!)

If this does the trick, then set the ownership of the directory to the user in question (HINT: if you create a file in the shared directory from the Windoze XP client, it will be owned by the Linux User whose access permissions are being used - regardless of any special Samba settings, winbindd, or otherwise. Use 'ls -l' on the server to see who owns the file Windoze XP created!)

Once you've figured it all out, don't forget to use chmod again to remove the excessive permissions! For user home directories, I typically use 'chmod 700 .' For shared directories, I'll use either 770 (if I'm limiting access to a specific group, or 777 (for all to access). In the latter case, I also recommend using the Sticky Bit (1777) so that people cannot so easily delete each others files!

Peace, Love, & Unix!

JZL240I-U 08-02-2006 01:28 AM

Thank you for this posting it4soho. It is not only nicely detailed but also very easy to understand, even for a non-Samba user :).

gkiagia 08-02-2006 11:28 AM

Quote:

Originally Posted by it4soho
:tisk: OK... first of all, Samba does NOT have separate permissions and usernames (what a NIGHTMARE that would be to implement!) Samba DOES (or more corectly, CAN) have a mapping of Windoze permissions to Linux permissions, and also has a username map (so that Linux username 'account123' can be accessed by the Windoze username 'Millie'). If you've enabled it, Samba can even use the Linux ACLs (Access Control Lists -- which let you go beyond the standard User/Group/Other permissions). But when it comes to accessing a file (in a directory that is properly shared), the Linux permissions "rule."

Ok, sorry. I don't know much about samba. This is probably what I meant: mapping.


All times are GMT -5. The time now is 07:16 AM.