LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-15-2016, 01:49 AM   #1
johnpedou
LQ Newbie
 
Registered: Dec 2016
Posts: 17

Rep: Reputation: Disabled
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.
 
Old 12-15-2016, 05:18 PM   #2
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,456

Rep: Reputation: 628Reputation: 628Reputation: 628Reputation: 628Reputation: 628Reputation: 628
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.
 
Old 12-15-2016, 05:30 PM   #3
johnpedou
LQ Newbie
 
Registered: Dec 2016
Posts: 17

Original Poster
Rep: Reputation: Disabled
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 05:32 PM.
 
Old 12-15-2016, 05:42 PM   #4
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,456

Rep: Reputation: 628Reputation: 628Reputation: 628Reputation: 628Reputation: 628Reputation: 628
Quote:
path = /samba/anonymous
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.
 
Old 12-15-2016, 05:58 PM   #5
johnpedou
LQ Newbie
 
Registered: Dec 2016
Posts: 17

Original Poster
Rep: Reputation: Disabled
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
 
Old 12-15-2016, 06:16 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,533

Rep: Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138Reputation: 3138
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.
 
Old 12-15-2016, 06:23 PM   #7
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
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.
 
Old 12-17-2016, 08:55 PM   #8
johnpedou
LQ Newbie
 
Registered: Dec 2016
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thank you all for the replies. Turned out to be an issue with the way I installed samba
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba shares not available to windows machines on the network joe30030 Linux - Newbie 5 03-22-2015 02:24 PM
Samba shares and windows machines lacitpo Linux - Software 2 02-26-2005 01:56 AM
Samba password doesn't work when accessing Linux shares from W2K soren625 Linux - Software 4 05-14-2004 06:55 AM
Accessing Samba Shares The_Q DamnSmallLinux 2 02-05-2004 05:36 AM
accessing samba shares is slow! kudos Linux - Software 2 11-26-2003 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration