Well, I have been able to figure this out with some quite extensive searching.
New Hard Disk Setup
I'll first start off with creating a second hard drive to use as the "shared" drive:
Code:
fdisk /dev/sdb
- option n
- option p
- option 1
- select defaults for the next 2 prompts
- option w
Next we will format the new partition with a file system. In this case, I used the ext4 file system on the new drive labeled sdb1 located in /dev
Code:
mkfs.ext4 /dev/sdb1
Create a mount point for the sdb1 partition
Now we will edit fstab to auto mount /dev/sdb1 upon boot. I used the nano text editor for this part. You can use which ever text editor you are comfortable with.
Add the following line to the bottom of the fstab config file
Code:
/dev/sdb1 /media/data ext4 defaults 0 0
Save the fstab config and reboot the server
Samba Setup
Start off by creating a directory to share using Samba.
Code:
mkdir -p /media/data/share
Now to install Samba!
Code:
apt-get install samba
Make a backup for the Samba configuration file just in case something happens.
Code:
cp /etc/samba/smb.conf /etc/samba/smb.conf.orig
Remove the default smb.conf file
Code:
rm /etc/samba/smb.conf
Create a new blank smb.conf file
Code:
touch /etc/samba/smb.conf
Edit the blank smb.conf file
Code:
nano /etc/samba/smb.conf
I have used the following config for the test environment and unfortunately I do not know all of the options that can be used inside of the smb.conf file
Code:
[global]
workgroup = workgroup
server string = Ubuntu File Server
netbios name = $servername
security = user
map to guest = bad user
dns proxy = no
[Photos]
path = /media/data/share
valid users = @$groupname
browsable = yes
writable = yes
guest ok = no
read only = no
create mask = 0644
directory mask = 0755
Once you have saved the new smb.conf file, reboot the services smbd & nmbd
Code:
restart smbd
restart nmbd
Create a new group for the Samba share
Code:
addgroup $groupname
Change group access to the share
Code:
chgrp -R $groupname /media/data/share
Change permissions to the root of the share
Code:
chmod 777 /media/data/share
Add a user account of the share group
Code:
adduser $username $groupname
Finally, create a share password for the user account
Code:
smbpasswd -a $username
You now will be able to access the network share from Windows.
Pure-FTPD Setup
Install pure-ftpd
Code:
apt-get install pure-ftpd
Add a virtual user to the ftp server and point it to the directory you want the virtual user to have access to when uploading files to the Samba share
Code:
pure-pw useradd $username -u $username -g $groupname -d /path/to/samba/share
Make the pure-ftpd database
Run this command (still trying to figure out what that does)
Code:
ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure
Restart the pure-ftpd service
Code:
service pure-ftpd restart
Now you have an FTP server that can drop files to a Samba share that can be accessed by those who use Windows desktops.
Bookmarks