Linux NAS Device
Introduction
Here are some config's for setting up a Linux NAS device
Location of Files
First off create a location for the files
mkdir /data
mkdir /data/www
mkdir /data/ftp
mkdir /data/ftp/upload
Set ownership
chown -R root:users /data
chown ftp /data/ftp/upload
Set permissions
chmod 0775 /data
chmod u+s /data
chmod g+s /data
chmod 0775 /data/www
chmod u+s /data/www
chmod g+s /data/www
chmod 0775 /data/ftp
chmod u+s /data/ftp
chmod g+s /data/ftp
Create Your Users
First create the local user accounts
useradd -u 1000 -G wheel -c "One Person" one
useradd -u 1001 -c "Two Person" two
useradd -u 1002 -c "Three Person" three
useradd -u 1003 -c "Four Person" four
useradd -u 1004 -c "Five Person" five
useradd -u 1005 -c "Six Person" six
Then create password each of them
passwd one
passwd two
passwd three
passwd four
passwd five
passwd six
Add them to the users group (or whatever you choose)
usermod -G wheel,users one
usermod -G users two
usermod -G users three
usermod -G users four
usermod -G users five
usermod -G users six
== Samba Setup ==
Here is the samba config for an ADS member server
[global]
workgroup = MYDOMAIN
realm = MYDOMAIN.COM
server string = Linux Testbed
security = ADS
password server = dc.mydomain.com
passdb backend = tdbsam
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[data]
comment = Data Direcory
path = /data
browseable = Yes
read only = No
</PRE>
Restart Samba
service smb restart
Then you have to join it to the domain
net ads join -U Administrator
== http access ==
If you want read access to files via web comment out all lines in
/etc/httpd/conf.d/welcome.conf
Make the following change and addition into /etc/httpd/conf/httpd.conf
#DocumentRoot "/var/www/html"
DocumentRoot "/data/www"
Also
<PRE>
<Directory "/data/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</PRE>
Restart Apache
service httpd restart
== ftp access ==
To allow for anonymous FTP Access both read and write
Note: you cannot write to root via ftp
edit /etc/vsftpd/vsftpd.conf
vi /etc/vsftpd/vsftpd.conf
Here are the settings
<PRE>
anonymous_enable=YES
anon_root=/data/ftp
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_umask=0002
anon_other_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
banner_file=/data/ftp/README
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
</PRE>
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer