|
Wednesday, 02 December 2009 18:56 |
|
This manual describes how to create file server, where users from can access their files with samba client and FTP server, (from windows too). In this example there are two users, testa and testu. User testa can read and write in admin (FTP only) and public directories. User testu can read and write in the public directory and can read admin directory.
In this example were used:
- FreeBSD 7.2
- VsFTP
- Samba Server
Let's Start
-
Create Users and Directories
- Create Users and answer all questions
Type in terminal
adduser testa ... adduser testu
File /etc /passwd should be like this
testu:*:1004:1002:testu:/home/testu:/usr/sbin/nologin testa:*:1005:1003:teata:/home/testa:/usr/sbin/nologin
Create groups named 'all' and 'admin' and edit /etc/group file like this
all:*:1002:testa admin:*:1003:
- Create Directories
mkdir /files mkdir /files/admin //Administrative access ex. for user testa mkdir /files/public //Public access ex. for user testu etc.
- Set permissions like this
files# ls -all / dr-xr-xr-x 4 admin admin 512 Sep 18 13:11 files files# ls -all /files/ drwxrwxr-x 3 admin admin 512 Oct 6 12:29 admin drwxrwxr-x 5 all all 512 Oct 6 12:43 public etc.
-
Install vsftp FTP Server
- Edit Config File
mcedit /usr/local/etc/vsftpd.conf
- Edit and add in vsftpd.conf
local_umask=0002 local_root=/files
- Restart FTP Server
/usr/local/etc/rc.d/vsftpd restart
-
Install Samba Server
- Edit Config File
mcedit /usr/local/etc/smb.conf
- Add
hosts allow = 192.168.0. 127.
[admin] comment = Admin Files path = /files/admin public = yes writeable = no read only = yes [public] comment = Public Files path = /files/public directory mask = 0775 create mask = 0664 force group = all force user = all public = yes writeable = yes read only = no
- Restart Samba Server
/usr/local/etc/rc.d/samba restart
If you need to add users who have administrator's access (for access /files/*) you need to add username into /etc/group after all:*:1002:testa, another_user. In this example user testa can create delete and read in /files/*, user testu only in /files/public/*
|