File Server With Samba and FTP in FreeBSD
|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
1adduser testa<br>...<br>adduser testu
File /etc /passwd should be like this
1testu:*:1004:1002:testu:
/home/testu
:
/usr/sbin/nologin
<br>testa:*:1005:1003:teata:
/home/testa
:
/usr/sbin/nologin
Create groups named ‘all’ and ‘admin’ and edit /etc/group file like this
1all:*:1002:testa<br>admin:*:1003:
- Create Directories
1
mkdir
/files
<br>
mkdir
/files/admin
//Administrative
access ex.
for
user testa<br>
mkdir
/files/public
//Public
access ex.
for
user testu
etc.
- Set permissions like this
1
files
# ls -all /<br>dr-xr-xr-x 4 admin admin 512 Sep 18 13:11 files
1files
# ls -all /files/<br>drwxrwxr-x 3 admin admin 512 Oct 6 12:29 admin<br>drwxrwxr-x 5 all all 512 Oct 6 12:43 public
etc.
- Create Users and answer all questions
-
Install vsftp FTP Server
- Edit Config File
1
mcedit
/usr/local/etc/vsftpd
.conf
- Edit and add in vsftpd.conf
1
local_umask=0002<br>local_root=
/files
- Restart FTP Server
1
/usr/local/etc/rc
.d
/vsftpd
restart
- Edit Config File
-
Install Samba Server
- Edit Config File
1
mcedit
/usr/local/etc/smb
.conf
- Add
1
hosts allow = 192.168.0. 127.<br><br>[admin]<br> comment = Admin Files<br> path =
/files/admin
<br> public =
yes
<br> writeable = no<br>
read
only =
yes
<br>[public]<br> comment = Public Files<br> path =
/files/public
<br> directory mask = 0775<br> create mask = 0664<br> force group = all<br> force user = all<br> public =
yes
<br> writeable =
yes
<br>
read
only = no
- Restart Samba Server
1
/usr/local/etc/rc
.d
/samba
restart
- Edit Config File
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/*
Exactly how long did it take u to create “File Server With Samba and
FTP in FreeBSD | LinuxConfig.net”? It possesses quite a
bit of good info. Appreciate it ,Bryant