Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-15-2016, 12:49 AM
|
#1
|
LQ Newbie
Registered: Dec 2016
Posts: 17
Rep:
|
Accessing Samba Shares on linux machines
I am struggling to access the samba shares I have made on my samba server. I have tried this on two separate machines and have been unable to get it to work either time.
One machine I used CentOS7 and tried accessing it from windows. I could pull up the share with the Run prompt but only by typing in the net bios name, (it would not work by typing in the IP address of the CentOS machine). However, when I tried clicking on the share a window would come up saying I don't have permission to access it (Also, for some reason, it did not require me to put in the username and smbpassword I set up). I tried changing permissions within the Samba directory to 777 and that still wouldn't work. So I tried from windows to change security permissions but I don't have permission to edit permissions.
The second machine I used an AWS instance and I could see the share from my windows machine, but when I would try to log in with the user name and password I set up it just said access denied and kept asking me to put the password in again or to use different credentials. I have looked on every tutorial I could find and could not get this to work. I just need to be able to put in the username and password for the samba server I set up and then access the file. Any help would be greatly valued.
|
|
|
12-15-2016, 04:18 PM
|
#2
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,295
|
For us to help, you need to post your /etc/samba/smb.conf file. That will give us a starting point.
Big picture, the way I set things up is to create a user on the server with the same user name as on the windows guest. You have to set a samba password for each user as well. When you first connect, you should see a user/password prompt to access the share.
Permission mission problems can be caused by where in the file system you make the shares. It would help if you could tell us some of those details as well.
When you post your smb.conf file, please use the quote tags, or go to advanced and use code tags. That makes the file easier for us to read.
|
|
|
12-15-2016, 04:30 PM
|
#3
|
LQ Newbie
Registered: Dec 2016
Posts: 17
Original Poster
Rep:
|
Ok so I made a user on my linux machine and set and smbpasswd for that user. I named the user 'test' and the directory where for the samba share is 'anonymous' below is the contents of my smb.conf file. I will include [global] and the one for anonymous
Quote:
[global]
workgroup = WORKGROUP
security = user
map to guest = bad user
netbios name = pedor
passdb backend = tdbsam
printing = cups
server string = Samba Server %v
printcap name = cups
load printers = yes
cups options = raw
dns proxy = no
[anonymous]
comment = Samba test share
read only = no
valid users = test
path = /samba/anonymous
writeable = yes
guest ok = no
browseable = yes
|
As a side note, thank you responding
Last edited by johnpedou; 12-15-2016 at 04:32 PM.
|
|
|
12-15-2016, 04:42 PM
|
#4
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,295
|
This is in the root of the file system, probably you created it with root ( or sudo ). So root will own it. Unless you have changed the ownership of anonymous to allow your 'test' user, you will get permission denied. This is how I set up a directory to allow my group of 'users' to connect.
Quote:
ls -ld data
drwxrwxr-x 4 cliff users 4.0K Apr 16 2016 data/
|
cliff is my user id, and group users is where I can add a user like test.
If you do a 'ls -ld' on anonymous dir, and see root root, test will not get in unless test belongs to the root group. That would be a major security risk.
Hop[e this helps.
|
|
|
12-15-2016, 04:58 PM
|
#5
|
LQ Newbie
Registered: Dec 2016
Posts: 17
Original Poster
Rep:
|
I did ls -ld anonymous and the output was
Quote:
drwxr-xr-x. 2 root root 19 Dec 15 12:26 anonymous
|
So I changed permissions and then ls -ld produced
Quote:
drwxrwxr-x. 2 test nobody 19 Dec 15 12:26 anonymous/
|
When I tried accessing it from my windows machine, the same window came up saying that I do not have permission to access the folder. This was an approach I previously tried on another machine but still could not get it to work
|
|
|
12-15-2016, 05:16 PM
|
#6
|
Moderator
Registered: Aug 2002
Posts: 26,111
|
The notes at the beginning of the /etc/samba/smb.conf file explains how to allow created directories with selinux enabled. Basically you run the following command as root.
chcon -t samba_share_t /path
The default samba configuration should allow access to users home directory which is not browseable by default.
Without knowing anything about the AWS distribution/configuration etc I don't know why it is not working at the moment.
|
|
|
12-15-2016, 05:23 PM
|
#7
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
In my use of Samba I restrict sharing to directories that are under the /home directory (user homes and other homes created for shared access). I share these same directories with NFS for linux clients. Without being 100% certain, I'm wondering if part of your problem isn't related to you trying to share something under the /samba directory. The "nobody" group resulting from your chown command seems odd as well .. My suggestion would be to restrict your sharing to subdirectories under /home.
|
|
|
12-17-2016, 07:55 PM
|
#8
|
LQ Newbie
Registered: Dec 2016
Posts: 17
Original Poster
Rep:
|
Thank you all for the replies. Turned out to be an issue with the way I installed samba
|
|
|
All times are GMT -5. The time now is 06:15 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|