Can't access Ubuntu's shared folders from Windows 7

172,307

Solution 1

Open Nautilus again as an ordinary user and modify the share to remove guest access. Type gksudo nautilus, navigate to the shared folder and share it again. Share the folder but do not give guest access. Close nautilus.

Go to your Windows box and access the share and provide the Ubuntu username and password.

Ensure your Ubuntu firewall allows incoming access to Samba ports. Ensure Windows firewall allows outgoing access for the same ports.

Solution 2

Have you installed Samba? sudo apt-get install samba

If so, then you need to set a Samba password: sudo smbpasswd -a USERNAME. This command will generate a prompt for a password (substitute USERNAME with your username).

Set a folder to share mkdir /home/USERNAME/sharedfolder

Make a backup copy of your smb.conf file: sudo cp /etc/samba/smb.conf ~

Open your smb.conf file: gksu gedit /etc/samba/smb.conf

Add this to the very end of the file:

[sharedfolder]
path = /home/USERNAME/sharedfolder
available = yes
valid users = USERNAME
read only = no
browsable = yes
public = yes
writable = yes

There should be NO spaces between the lines, and there should be a single space both before and after each of the equal signs. Save and exit gedit.

Restart Samba sudo restart smbd

Use this command to check your smb.conf file for syntax errors: sudo testparm

You now should be able to share from your Windows 7 machine.

Edit:

I understand your trying to access your Ubuntu share from Windows 7 and that you want to do so with a GUI interface.

but when I try to access them (from Windows) it asks for a username and password. No matter what I enter, it won't let me in. How do I configure this to share normally?

To do so you must set up a Samba user/password on your Linux machine as I described above. I could recommend a GUI program for Ubuntu to do this, but frankly it's much more complicated and confusing to do it that way. The program is gadmin-samba and it's in the Ubuntu repository. Caution! you can totally bork your config if you misuse this program. Please let us know what steps you've now taken, and which errors you have encountered. Thanks!

Solution 3

I have a ubuntu server with a number of computers and laptops running Windows 7 and found that one laptop would not allow access to files in folders stating "You may not have permission etc". Scoured the internet for 3 days - no luck. Finally decided to ask my son who installed the server and he said that Windows 7 can store passwords to the server and sometimes these become corrupt. The simple answer was as follows :-

If you saved a password for a network drive in windows and want to remove it, press the keys [Windows] + [R] to open the windows command line. Then enter

control keymgr.dll

and click on “OK” to open the windows credential manager which allows you to manage and delete passwords saved in Windows.

Highlight server and click REMOVE FROM VAULT

Reboot computer.

This procedure works for Windows XP, Vista and Windows 7.

Solution 4

I completely uninstalled and purged samba and samba-common, then reinstalled them and all the packages that depended on them. Now the GUI sharing and computer's hostname works again, though it only works in Guest mode.

I haven't figured out what credentials to use otherwise. WINDOWSMACHINE/winusername UBUNTUMACHINE/ubuntuusername or just plain username. Nothing works. But Guest mode works.

The folders I'm sharing contain other folders. Sometimes these are inaccessible to the Windows machine and sometimes they're accessible. Apparently when it says "let me configure permissions for you", it only does i for the folder you're sharing, not the subfolders. If the folder permissions for "Group" and "Others" aren't set to "Create and delete files", then you can't access it in guest mode.

Solution 5

I had the same problem. "You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions". All was working fine with samba until doing a fresh install of 11.10 (the upgrade install did not break samba shares).

I installed "Samba Server Configuration Tool 1.2.63" and it showed that the default user was nobody. Changed that to coincide with my password and all worked fine after that. I had compared my samba config files and nothing was different. The tool mentioned fixed it.

Share:
172,307
endolith
Author by

endolith

I mostly use Windows 7 but have a home server that runs the latest LTS Ubuntu, with Mate desktop (as of 2019-03)

Updated on September 17, 2022

Comments

  • endolith
    endolith over 1 year

    In Ubuntu Maverick, I've shared some folders using the Nautilus "Sharing Options" GUI.

    alt text

    I can see them from Windows 7, but when I try to access them (from Windows) it asks for a username and password. No matter what I enter, it won't let me in. How do I configure this to share normally?

    Update: I've found that some of the shared folders let me in, but others don't. Of the ones that do, some of their subfolders do, others don't, etc. How can I investigate what's causing this?

    When I let the GUI install what it needs, it installs samba and libpam-smbpass. On the machine I am having trouble connecting to, libpam-smbpass is not installed. Could this be the problem?

    • flo
      flo over 13 years
      Related Question: askubuntu.com/questions/14345
    • flo
      flo over 13 years
      Related Question: askubuntu.com/questions/12254
    • endolith
      endolith over 13 years
      Related Question: askubuntu.com/questions/17770
    • Admin
      Admin over 13 years
      I have the same Problem. It used to work without problems. I could access the ubuntu pc it used to ask for username - password and everything was ok After an update that took place 2 days ago for me, i started having the same problem. Now i can access the shared folder only when it is in guest mode. When it is not in guest mode, it asks for a username password but when i type it, it says " \\Ubuntu\downloads is not accessible.You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions Multiple conne
    • Yibo Yang
      Yibo Yang over 7 years
      after 2 hrs of frustration, I solved this problem by restarting my computers...
  • endolith
    endolith over 13 years
    I'm not sharing from Windows. I'm sharing from Ubuntu and accessing it from Windows 7. Samba is already installed, but I'm using the GUI to share, not the command line.
  • endolith
    endolith over 13 years
    Is gadmin-samba the official tool to configure this? Why would I need to configure a user or password separately from sharing the folders?
  • endolith
    endolith over 13 years
    Can you explain what this does? Does it have side effects?
  • nejode
    nejode over 13 years
    Not any that I know of. This only opens up Win7 to the samba protocol. I use it in the office where 3 Win7 machines connect to an Ubuntu server. Try it out, you can always change everything back easily if you need to... which I doubt.
  • luri
    luri over 13 years
    AFAIK, you've got to use your plain Ubuntu username. Can you access the folder (not yet the subfolders)? Have you got system-config-samba? If so, open System -> Administration -> Samba, and check Preferences -> Samba users
  • endolith
    endolith about 13 years
    It works! But.... why??
  • BZ1
    BZ1 about 13 years
    I had the same problem. I am not sure why it does not allow guest access. May be Ubuntu thought that it was a security flaw that could be exploited. I guess there is some other setting that needs to be enabled for the guest access option to work. Maybe that's why they did not totally remove that option.
  • endolith
    endolith over 12 years
    Can you explain what this does? Does it have side effects?
  • David LeBauer
    David LeBauer over 12 years
    @endolith I have updated my answer.
  • Rich.T.
    Rich.T. almost 11 years
    To create a shared folder, accessible through Win7, in Ubuntu 13.04, I did: sudo smbpasswd -a USERNAME to create a samba user for me, then used right-click menu options to set sharing and permissions. As I created a shared folder outside of my home folder, I had to right-click the folder and set permissions to Owner, Group, and Others - Access: Create and Delete Files. I did not alter my smb.conf and this file does not show any shares configured within. This GUI process seems to work outside of SAMBA's conventions. This is worrying and confusing.
  • Emily L.
    Emily L. almost 9 years
    This saved my day.
  • Enigma
    Enigma over 8 years
    @luri Thousand times thank you for mentioning system-config-samba. Why oh why is the default state of things still so dysfunctional for something this basic. How is anyone supposed to know their user account isn't enabled as a samba account when you need some obscure additional software to even tell. This needs to be integrated into the System Settings > Users section. Either that or it needs to be integrated into the actual share properties.
  • endolith
    endolith over 7 years
    now it doesn't work. why is samba such a nightmare?