I have two PCs on my internal LAN. One is running windows 10 and the other is running Ubuntu 16.04. I am trying to share a folder in Ubuntu so that I can access it from windows 10. I have done:
And the clicked "Create Share" which completed without any errors. I also see the shared folder in windows but I need to provide user/password to access it. When I do that, using the same user/password I use to login to Ubuntu, I just get access denied:
Why can't I access that folder using my Ubuntu user credentials?
The way to share folders for other operating systems is a bit different and it needs a little bit of work. Let's go.
sudo apt-get install samba system-config-samba
For example:
sudo mkdir /Public
sudo chmod -R 0777 /Public
to make it fully accessible by everyone.sudo adduser --no-create-home <network_user_name>
to create a new user whose name will be used to access the shared folder from the network. Since this user is going to be a network user only, no home folder is needed for them.sudo usermod -u 998 <network_user_name>
to change the new user ID to anything below 1000 so that the name is not included in the lightdm logon list.sudo smbpasswd -a <network_user_name>
to add the new user to the samba user list so that access can be granted when this user attempts to connect from another system.Note: This password has nothing to do with the user password you created when you created the user with the
adduser
command and it doesn't have to be the same. The other password will never be used. This is the password you will be using to access the system from the network.samba
from its icon and enter your admin password.On the first tab, browse to the /Public folder and select it in order to share it. Make it Visible and Writable if you wish to have write access to it from the network.
On the second tab make sure to check the network_user_name you'll see so that only that user is granted access to that share and not everyone.
/etc/samba/smb.conf
. At the end of that file you will see the details about the folder you just shared. Press Enter and Tab and add the parameterinherit permissions = yes
at the very end of that shared folder section. This will make sure that every new file or folder created by the network user in that share will inherit the /Public folder's permissions and it'll be fully accessible by all other users.sudo service smbd restart && sudo service nmbd restart
to restart both services with the new parameter and you should be ready to use that share from any operating system including Windows.Set manual IP addresses
Comp 1
IP 192.168.1.2
255.255.255.255
Gateway: 192.168.1.1
Comp 2
IP 192.168.1.3
255.255.255.255
Gateway: 192.168.1.1
DNS
8.8.8.8
4.4.4.4
The internet won't work but you will be able to share files.