LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Samba question (https://www.linuxquestions.org/questions/slackware-14/samba-question-621854/)

em21701 02-17-2008 04:54 PM

Samba question
 
I have recently installed Slack 12 on my desktop machine changing from Kubuntu. During installation I created a partition specifically to use as a Samba share (/public). How can I share that a partition in Samba? I currently get the error "You can only share folders that are in your /home directory" or something to that effect. I would rather not set it up as root (if that is possible).

Thanks in advance,
Eric

gilead 02-17-2008 06:15 PM

There's no problem with setting it up as root, if by that you mean logging in as root, editing /etc/samba/smb.conf, creating a share and re-starting Samba. It's possible to restrict shares to users or groups and to force file and directory creation masks. For example:
Code:

[testshare]
  comment = Shared area for general access by the managers group
  path = /public
  writable = yes
  available = yes
  valid users = @managers
  create mask = 0660
  directory mask = 0770
  force group = managers

The Samba by Example docs are useful for setting up different share types.

em21701 02-18-2008 05:54 AM

Thank you gilead, I'll Give that a try tonight. I'll certainly read through the Samba by Example pages as well.

Thanks again,
Eric

evilDagmar 02-20-2008 01:04 AM

Pfft. Edit /etc/inetd.conf and uncomment the line relating to SWAT, then `killall -HUP inetd` to tell the superserver daemon to re-read it's config file. Then point your browser at http://thatmachinename:901 and use the wizard to configure Samba. Much, much easier.

em21701 02-21-2008 07:25 PM

the wizard is certainy easier, however I can not see the server on any of my other machines. It may be a router thing, I'll have to look into it more.

nekkutta 02-23-2008 03:17 PM

are you just wanting a file server that any machine on your network can access? if so I can help here.

Here is my smb.conf file, notice the include statement so I can add machine specific shares to smb.conf.<machine name>

basically I added a user to the system (smbaccess) and added a directory (samba) to the home directory that I have a 320GB drive mounted to. smbaccess is the owner for that whole directory tree

also you might like to add a default WINS server in your routers dhcpd configuration to point at a samba system or a windows system, I had to do that before my network neighborhood would behave correctly (stupid windows)

pay attention to the hosts allow statement and edit it to your network

Code:

# the user needed for guest account is smbaccess
[global]
workgroup = MSHOME
security = share
netbios name = MICRON
null passwords = yes
passwd chat timeout = 26
server signing = Auto
server string = Samba %v on %L
paranoid server security = no
wins support = yes
preferred master = yes
time server = yes
domain master = yes
local master = yes
os level = 190
ldap ssl = No
disable netbios = no
DNS Proxy = no
name resolve order = bcast wins
hosts allow = 192.168.1. 192.168.2.
hosts deny = ALL
restrict anonymous = no
message command = /bin/mail -s "SMB Message From %f on %m" root <%s; rm %s &
deadtime = 10
:max disk size = 20000
read only = yes
guest account = smbaccess
invalid users = root bin daemon adm sync halt mail news uucp operator
load printers = no
include = /etc/samba/smb.conf.%m



[global share]
path = /home/samba/gshares
guest ok = yes
guest only = yes
browseable = yes
case sensitive = no
write ok = yes

[backup]
path = /home/samba/backup
guest ok = yes
guest only = yes
browseable = no
case sensitive = no
write ok = yes

[Linux]
path = /home/samba/linux
guest ok = yes
guest only = yes
case sensitive = no
write ok = no

[MP3s]
path = /home/samba/mp3s
guest ok = yes
guest only = yes
case sensitive = no
write ok = yes

hope that helps a bit
nekkutta

em21701 02-24-2008 07:30 PM

Thanks, nekkutta that is exactly what I am trying to do. I have already created a new user (sambauser) and a new group (sambagroup) with ownership of all the files in the shared directory (/public) I have not had enough time to play with the samba/router configuration.

Thanks again,
Eric

nekkutta 02-24-2008 08:59 PM

another thing you might want to do is add a root cron entry for '/bin/chown -R sambauser:sambagroup <your shared base directory>/*' that way if you ssh to the machine and move stuff around with someone other than sambauser (ie. root) you won't have to worry about permissions. I've gotten bitten by that a couple times before I looked up how to use cron.

nekkutta


All times are GMT -5. The time now is 02:28 PM.