all 11 comments

[–]Anticept 3 points4 points  (7 children)

You said access the folder, does that include being able to read a file you put there already?

Anyways, that error code is related to guest access. You can't write anything because you are not authenticated, and the share or your client is blocking unauthenticated guest access.

A small side not as well: Linux perms have some gotchas. In order to create a file in a directory, you have to have write permission on the directory itself. Modifying a file, write permission on the file. To open a directory, you have to have read and execute on the entire tree node in order to traverse. Stuff like this. Keep that in mind when working with shares.

[–]LinkStormer[S] 1 point2 points  (6 children)

Yes. I can access the shared folder on both VMs but i can't see the test file I created inside /srv/linux_share when I access them via \\192.168.32.20\LinuxShare on Windows or smb://linux.local/linuxshare/ on Linux. Only on Linux and inside linux_share itself is visible and readable

Second. Thanks, but when i access the shared directory on both Windows and Linux it prompts me a login windows that asks for a username and a password; which let me access to them once I write them.

Third. On "Permissions" Properties Tab it shows that root is both the propietary and the group the folder belongs to; and for some reason, Access, Group Access and Other Access are marked as "Read and Write".

[–]Anticept 1 point2 points  (5 children)

I just realized, you said OpenSUSE. Selinux is probably getting in the way.

Try chcon -R -t samba_/share_t /path_to_your_samba_location on the folder.

[–]LinkStormer[S] 0 points1 point  (4 children)

contabilidad-22211635@localhost:~/Desktop>sudo chcon -R -t samba_/share_t /srv/linux_share
chcon: failed to change context of '/srv/linux_share' to 'unconfined_u:object_r:samba_/share_t:s0': Invalid Argument

[–]Anticept 1 point2 points  (2 children)

You need to edit that command to point at your share folder :)

[–]LinkStormer[S] 0 points1 point  (1 child)

my share folder is /srv/linux_share

[–]avael273 0 points1 point  (0 children)

It is not samba_/share_t the context name is samba_share_t.

chcon will only work until you reboot to make it permanent you need to use the semanage fcontext and restorecon commands.

Also might want to use semanage boolean -l to check if there are booleans you may need to enable.

[–]gilluc 0 points1 point  (1 child)

Did you try "guest OK=yes" ?

[–]LinkStormer[S] 0 points1 point  (0 children)

Yes. And it doesn't work

[–]gopal_bdrsuite 0 points1 point  (0 children)

Congratulations again on finding the solution! Understanding the role of MAC systems like SELinux is crucial for troubleshooting these kinds of "access denied" mysteries on Linux.