Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

Sharing Files

This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com


Objectives covered

209.1 Samba Server Configuration (w:5)

209.2 NFS Server Configuration (w:3)

212.2 Managing FTP Servers (w:2)

2
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
1 Samba Server Configuration

This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com


Understanding Samba

4
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Samba packages
Red Hat based Debian based

5
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Directories & Files
/etc/samba/smb.conf

• The primary configuration file of samba

/var/log/samba

• The directory that samba store its log files

/var/lib/samba

• Samba uses this directory and its subdirectories


for storing things such as Samba user databases
6
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Samba Utilities

7
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Server file share
Steps to create server file shares:

8
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb.conf
Samba configuration file section names

9
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb.conf
Global section

10
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb.conf

File share section

11
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – check smb.conf syntax

12
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – add client account

13
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Start smb and check

14
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb ports

15
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb client

16
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb client - installing

17
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb client – add user

18
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – smb client – mount

19
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – client mount at boot

20
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Config user map

On smb.conf global section On map file

The /path/ is typically /etc/samba/, but the map-file-


name varies.

Sample map file 21


This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Security modes

22
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Join to AD

Join smb server to domain


Modify the nsswitch.conf file
23
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Server printer share

24
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Samba – Client printer access

Submit print job


Check the printer share

25
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Troubleshooting samba
Use the testparm utility

Make sure the daemon is running

Perform a basic Samba share check

Employ the correct workgroup setting

Perform basic network diagnostics

Review the log files

Increase the logging debug level

Check basic Samba status

Look up NetBIOS information

Review user/group settings

26
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
2 NFS Server Configuration

This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com


Understanding NFS
NFSv2

•Defined around 1989, this older NFS version


uses only UDP, has serious perfor- mance issues

NFSv3

•Defined in 1995, can use either UPD or TCP. It


also allows asynchronous writes and other
optimized operations

NFSv4

•originally defined in 2000, redefined in 2015,


provides all NFSv3’s features. NFSv4 provides
superior performance, enhanced security, better
scalability

28
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
NFS daemon and kernel services

29
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Installing NFS
Red Hat based Debian based

30
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
NFS directories and files

31
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
NFS directories and files
export_directory client-designation (directives)

client-designation
Driectives
32
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
NFS utilities

exportfs options

33
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring temporary NFS export

On server On Client 34
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring permanent NFS export

On server On Client 35
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring permanent NFS export - fstab

36
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Securing NFS
Use TCP

Limit wildcard use

Squash remote root access

Squash everyone

Manage access to ports

37
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Securing NFS – TCP Wraper

For example:

38
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Troubleshooting NFS
Check the /etc/exports file

Verify that the proper NFS daemons are running

Review the NFS ports

Perform basic NFS export checks

Employ basic network diagnostics

Review the log file

Check the NFS client view

Check the NFS export options


39
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
3 Managing FTP Servers

This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com


Understanding FTP

41
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
FTP server and client packages
Server packages Client applications

42
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring vsftpd
Primary configuration file: vsftpd.conf
(located in either the /etc/ directory or the /etc/vsftpd/)

43
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Accessing vsftpd server

OR

44
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Accessing vsftpd server - anonymous
For Download For Upload

45
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Pure-FTPd
The Pure-FTPd daemon, pure-fptd, can be run from the command line and
has many use- ful options.

46
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
Configuring Pure-FTPd – Anonymous access
Configuration files in the /etc/pure-ftpd/ or /etc/default/ directory or within a
/etc/pure-ftpd/ subdirectory

Anonymous Download
To allow Anonymous Upload

47
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com
THANKS!
ANY QUESTIONS?

48
This document is created by Nguyen Hoang Chi chi.nguyen.e4w@gmail.com

You might also like