VectorLinux
October 31, 2014, 02:16:24 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Vector as a File Server  (Read 2035 times)
Sty
Packager
Vectorite
****
Posts: 114


« on: January 12, 2008, 01:06:20 pm »

Hey guys, I'm trying to configure Vector for a Home Network File Server.  I'm currently using the 5.9 Standard Gold release, no customizations.  So far I have set up SWAT with the user accounts and started making shares, however this isn't working 100% correctly.

I can see the server on the network, however I cannot log in as "root".  When I log in as individual users, i.e. "russell", I get my home directory and nothing else.

The way I want this to work is that on the other hard drive, hdb1, I have set up several different folders.  One for videos, one for music, one for programs, etc.  I would like things like videos, music, programs, to be read/write for all authorized users (those logged in).  Then personal directories I want read/write by the user, readable by all others (this keeps kids in the house from putting undesirable content on my server), my directory I want only read/write able by myself (this will store sensitive work information, so I don't want anyone to be able to casually access this), lastly I want a backup directory which is read/write by anyone (even if not logged in).  That last directory is just so that if someone needs me to work on their computer I can quickly back up data just in case without having to worry about passwords to my network being saved.  It is a wireless network, so there is some risk of this.

Now then, I've set up shares for the different folders, pointing to their location "/mnt/hdb1/folder_name" with authorized users being "user1, user 2, etc."  However, as I said they aren't showing up as options when attempting from Windows.

So, if someone would be so kind as to walk me through some steps to finish this up, I'd be much abliged.  Thanks!
Logged

* Enterprise *
Running Vector Linux 5.9 Deluxe
|| Intel Core2Duo E6600 | 4 GB DDR2 RAM | ATi Radeon X1900XT ||
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #1 on: January 12, 2008, 02:31:36 pm »

Look in your /etc/samba/smb.conf file. At the end there should be a section called "Share Definitions". Copy and post that section in  this thread.

A few things have to be in order for this to work:
- Firewall, if present, must allow this file sharing
- The samba server running. It can be set to automatically start, using vasm
- Your users need samba passwords. Assign with smbpasswd -a [password]
- Directories to be shared must exist and have proper file permissions set
- The share definitions must point to the above shares and permissions defined in smb.conf

As you can see, you will need to contend with two sets of permissions, one by the file system and one by the samba server.
Logged
Sty
Packager
Vectorite
****
Posts: 114


« Reply #2 on: January 12, 2008, 03:38:10 pm »

Howdy, nightflier.  I'm glad you're still around to help. Smiley

Samba Configuration:
Code:
# Samba config file created using SWAT
# from 127.0.0.1 (127.0.0.1)
# Date: 2000/01/05 02:54:54

[global]
workgroup = HOLONET
server string = Samba Server
log file = /var/log/samba.%m
max log size = 50
dns proxy = No
valid users = russell, yates
admin users = russell

[homes]
comment = Home Directories
read only = No
browseable = No

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

[Programs]
comment = Program Installations
path = /mnt/hdb1/Programs
username = russell, yates, root
valid users =
admin users = russell, root
read only = No
only user = Yes
browseable = No
available = No

1) I have not yet activated the firewall.  Wanted to keep things as simple as possible until I get everything working just right.

2) I have set Samba to start at server boot.  Samba is currently running.

3) Using SWAT, I created user accounts to match the linux accounts.  I then gave the accounts passwords that correspond with the linux password.  Finally, I activated the accounts inside of SWAT.

4) The way I currently have the permissions set on the second drive (hdb1 - only partition) are (as seen in Thunar):
 -- Shared Folders (Music, Videos, Program Installs, etc.): Owner: root, read / write, Group: users, read / write; Others: read only
 -- User Folders (one for each user): Owner: root, read / write, Group: "user_name", read / write; Others: read only
 -- My Work Folder: Owner: root, read / write; Group: russell, read / write; Others: none
 -- Data Backup Dump (not setup yet): Owner: root, read / write; Group: users, read / write; Others: read / write

5) I don't entirely understand what you mean here.  If it is SWAT shares, then I am in the process of making one for each folder, pointing to /mnt/hdb1/"folder_name".  I'm not quite sure how to set up the permissions though, I outline what I have done in my prior post though.

(Going to post, then edit post the smb.conf.  I tried to include it before and the computer rebooted.  I'm not sure if that's because I kicked a wire at the same time though.  Better safe than sorry.)
« Last Edit: January 12, 2008, 03:40:23 pm by Sty » Logged

* Enterprise *
Running Vector Linux 5.9 Deluxe
|| Intel Core2Duo E6600 | 4 GB DDR2 RAM | ATi Radeon X1900XT ||
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #3 on: January 12, 2008, 05:41:39 pm »

Hi, Sty  Smiley

I'm not familiar with SWAT, so bear with me if I don't address it. Let's do this in steps.

Add this to your [global] section:
Code:
security = user

When it comes to your shares, you should make a definition for each shared dir.

Let's say you want /mnt/hdb1/public to be world read/writable: As root, issue commands:
mkdir /mnt/hdb1/public
chmod 777 /mnt/hdb1/public

This makes it wide open. Anyone can do whatever they want in here.

Then you add this to your smb.conf file:
Code:
[Public]
   comment = Public share
   writable = yes
   path = /mnt/hdb1/public
   public = yes

Issue command service samba restart

Now you should see the share "Public" when browsing to your server and be able to read and write to it.
Logged
Sty
Packager
Vectorite
****
Posts: 114


« Reply #4 on: January 12, 2008, 08:27:39 pm »

Ok, nightflier that works.

Next step?
Logged

* Enterprise *
Running Vector Linux 5.9 Deluxe
|| Intel Core2Duo E6600 | 4 GB DDR2 RAM | ATi Radeon X1900XT ||
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #5 on: January 13, 2008, 04:02:18 am »

Make a Private share:
mkdir /mnt/hdb1/russell
chown russell:russell /mnt/hdb1/russell

Define the share in smb.conf:
Code:
[Private]
   comment = Private
   writable = yes
   path = /mnt/hdb1/russell
   public = no
   valid users = russell

Restart samba server and test.

Make a read-only share:
mkdir /mnt/hdb1/readonly

Define the share in smb.conf:
Code:
[Read-only]
   comment = Read-only, must be local and root to write.
   writable = no
   path = /mnt/hdb1/readonly
   public = yes

I never use root as a samba user. If I want root power, I always use ssh to connect.

Samba has a lot of available options. This only scratches the surface, but is about all that I use. As you can see, it's pretty easy to control by editing the config file. The default smb.conf that ships with samba is well commented with valuable hints. SWAT strips all that out and leaves you with just the controlling information. Look in /etc/samba and see if it left a copy of the original file. Otherwise, google will find all you need to know and more.

HTH
Logged
Sty
Packager
Vectorite
****
Posts: 114


« Reply #6 on: January 13, 2008, 02:45:26 pm »

I won't be at that computer until later tonight.  But, do I seperate valid users by comma?  In other words, would russell, "user2" be valid?  Thanks.
Logged

* Enterprise *
Running Vector Linux 5.9 Deluxe
|| Intel Core2Duo E6600 | 4 GB DDR2 RAM | ATi Radeon X1900XT ||
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #7 on: January 13, 2008, 06:29:57 pm »

Try separating valid users with a space.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!