Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to access a folder on my new Ubuntu 12.10 box from any machine on my network without the need to provide credentials.

My machine name is Ubuntu1

I have a 2TB disk that formatted NTFS that has media on it

The mount point is mount1

I have numerous folders on the disk and I want to share each of them individually

I have enabled folder1 and folder2 for sharing

I have enabled shared access, Allow others to create and delete files in this folder and guest access is allowed.

The folder icon now has arrows so I assume all is good.

From windows I can see under network

Ubuntu1>folder1 Ubuntu1>folder2

When I click to open the folder from windows I get the error "You cannot access \Ubuntu1\folder1

You do not have permission to access \Ubuntu1\folder1

I have them both on the same workgroup.

Your assistance would be appreciated

share|improve this question
    
please read this one wiki.ubuntu.com/MountWindowsSharesPermanently –  user128296 Dec 17 '12 at 10:15
    
@user128296: That guide talks about mounting Windows shares on Ubuntu: Ron is trying to share folders from Ubuntu and mount them on Windows, which is quite different. –  Paul Whittaker Dec 16 '13 at 18:31
add comment

5 Answers

Samba needs you to authenticate as a valid user.

You either have to enable guest access or create a user with the same username/password combination on Windows...

share|improve this answer
add comment

As falstaff explained, you need to allow guest from your Ubuntu1 machine or create credentials.

I suggest you to have a look at this guide.

I used it to fix access from both sides (linux/windows clients) to access other SMB shares.

share|improve this answer
    
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Eliah Kagan Dec 19 '12 at 6:28
add comment

Hi the answers already here are good and correct but they do not show that there is a very easy way to fix this using the Ubuntu GUI way.

Right click on your folder you want to share got to the sharing properties and choose,

Allow others to create and delete files in this folder

and

Guest Access (for people without a user account)

as this image shows.

enter image description here

or you can do as Falstaff has correctly said to create an account on Windows with the same user name and pass, or vice versa, create a unix account with the same user pass.

share|improve this answer
    
Sorry I am Lynx newbie and am not real comfortable with the terminal advice given I can't easily translate from the example to my system. –  Ron Dec 18 '12 at 11:25
    
This is exactly how I changed permissions. I rebooted and have found these errors in log files [2012/12/17 20:22:04.543567, 0] smbd/service.c:1055(make_connection_snum) canonicalize_connect_path failed for service Music, path /media/ron/wd2tb_bottom/Music –  Ron Dec 18 '12 at 11:37
    
Other errors[2012/12/17 20:23:28.523873, 0] smbd/service.c:1055(make_connection_snum) canonicalize_connect_path failed for service AudioBooks, path /media/ron/wd2tb_bottom/AudioBooks [2012/12/17 20:28:16.968188, 0] param/loadparm.c:9114(process_usershare_file) process_usershare_file: stat of /var/lib/samba/usershares/audiobooks failed. Permission denied –  Ron Dec 18 '12 at 11:41
    
[2012/12/17 20:46:59.237641, 0] param/loadparm.c:6498(canonicalize_servicename) canonicalize_servicename: NULL source name! –  Ron Dec 18 '12 at 11:41
    
2012/12/17 22:41:21.644314, 0] lib/util.c:1117(smb_panic) PANIC (pid 3056): internal error [2012/12/17 22:41:21.757819, 0] lib/util.c:1221(log_stack_trace) BACKTRACE: 23 stack frames: #0 smbd(log_stack_trace+0x29) [0xb718e8a9] #1 smbd(smb_panic+0x28) [0xb718e9a8] #2 smbd(+0x42daf2) [0xb717daf2] #3 [0xb6d2d400] .... smb_panic(): action returned status 0 [2012/12/17 22:41:22.052098, 0] lib/fault.c:372(dump_core) dumping core in /var/log/samba/cores/smbd –  Ron Dec 18 '12 at 11:43
add comment

Try running this command on your Ubuntu server:

sudo -u nobody ls "/path/to/my/share"

That will try to access your shared folder as user nobody. If you see an error like this:

ls: cannot access /path/to/my/share: Permission denied

then your local permissions are the problem (or at least a part of it).


Samba uses Linux filesystem permissions to determine whether it should grant access to shared files; if permissions block access to the shared folder itself, Samba will refuse to allow other machines to connect to the share at all. Guest access uses the nobody user (from group nogroup), so you should use the 'other user' file permissions to ensure that guests can access your shared folder.


It's important to check permissions on all the directories leading from / down to your shared folder too: if a user doesn't have execute permissions for a directory then they're prevented for accessing any paths below that point, including your share. (I created the ls error message above by removing 'x' permissions from an intermediate directory.)

Let's say you wanted to share /mnt/external/ntfs-drive/folder. You could add the 'x' permissions on all the parent directories with this command:

sudo chmod o+x /mnt /mnt/external /mnt/external/ntfs-drive

You also need to set read, write and execute permissions for the shared folder and any contents, but for parent directories execute permission is enough.

share|improve this answer
    
(Just in case it's not obvious to everyone else:) If the Samba logs say stat of /var/lib/samba/usershares/myshare failed. Permission denied then you should ignore what that actually says, and instead try reading it as stat of THE SHARED FOLDER NAMED BY /var/lib/usershares/myshare failed. Permission denied.... –  Paul Whittaker Dec 16 '13 at 18:42
add comment

I had the same problem where I could not share files even with the guest access enabled. I also had the same stat permission denied errors in my log. Apparently these errors are "normal" and are not the real problem. In my case the problem was my home directory permissions. My permissions were rwx for the user and no permissions for group or other. Setting the execute bit for "other" users fixed the problem. Something like this should do the trick:

sudo chmod o+x /home/your-home
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.