Professional Documents
Culture Documents
NW Services Lec11 - Mail
NW Services Lec11 - Mail
NW Services Lec11 - Mail
Lecturer:
• FTP client programs can enable users to transfer files to and from
a remote system running an FTP server program(like : Browser).
• FTP Modes:
– Active FTP The client starts listening on a random port for incoming
data connections from the server. It sends the FTP command PORT to
inform the server on which port it is listening.
– Passive FTP The FTP client initiates both connections to the server.
FTP Modes
• We can also verify that it's running by connecting to the ftp server
with an ftp client
• Lftp is an ftp client program that allows us to connect to an ftp server.
– #lftp localhost
Configuring Services in Linux
• default behavior of the ftp server is to be locked down.
– because most services read their configuration when they start, and then
keep it in memory while they're running.
• In order for our service to re-read the configuration, we need to tell it to reload.
• Reloading means that the service re-reads the configuration file without having
to stop and start.
• Also ongoing connections aren't interrupted, but new connections will use a
new configuration.
share.
• The portmap service is required to map RPC requests to the correct services.
• It helps to secure the file & directories that share through /etc/exports.
Setup an NFS
• The easiest way to setup an NFS server is by using a Linux
environment.
1. install NFS server software that modifies the configuration files for
the directories that you want to allow shared access to.
2. Then the NFS service will be running in the background of the
server.
3. On each client machine that wants to access a server, you just
mount the file system the way you would any other file system.
Except, you'd use the host name instead of a physical disk device.
4. From there, you can access the shared directory like you would
any other folder in a computer.
Server Side
• The NFS have 2 packages (portmap and nfs-utils) and the installed by
default, so just Check them by run:
#gedit /etc/exports
• Each Entry specifies the host, the file system, the permissions
and options.
Server Side
• After finishing work with the directories, Exports them to the system by run:
#exportfs –a
• Restart the service:
#service nfs restart
• To find or verify the directories that shared by the server:
#exoprtfs
• To find or verify the directories that shared on the client:
#mount
• You can use system-config-nfs to configure NFS Server. Using GUI tool.
Client Side
• The NFS service is installed by defaults.
• Check for the list of shared NFS directories :
#showmount -e
• To access the Shared files in Server, use the mount command:
– Name resolution.
– Browsing.
SAMBA
• Linux systems provide transparent and reliable SMB support over
TCP/IP via a package known as Samba. In sharing service you can:
o The system-config-samba package installs the Red Hat Samba Server Configuration utility.
o The samba-common RPM package contains common Samba configuration files. Generate
/etc/samba/smb.conf.
Or
– security Indicates how security is handled. The default is set to security = user , which requires users
to have a valid username that is managed by the Samba server and mapped to a Linux user account
name.
– host allow A comma, space, or tab-delimited list of hosts that are allowed access to the Samba
service. See man 5 hosts_access for details on the format that needs to be used.
– load printers This option, which by default is set to yes, ensures that printers from the CUPS print
– cups options This option is used to specify that print driver processing is handled by CUPS and at the
– log file Specifies the name of the file that Samba writes log messages to .
Creating Shares by Editing smb.conf
• Common Directory Share Options: directives that define the share.
– path The path on the Linux file system of the shared directory.
– writable Enables write access on a share. If set to yes, all authenticated users have write access (if also
permitted by Linux permissions). If set to no, a comma separated write list of users or groups can be used to
specify names of users and groups that have write permissions on the share. (See also read only.)
– read only Setting the read only parameter to no has the same effect as setting writable to yes.
– write list Contains a comma separated list of users or groups that have write access, even if writable is set
to no. To use groups, put a @ or + in front of the group name.
– valid users Use to limit access to the share to listed users only. By default all users have access to the share.
– comment Use to specify a comment. This comment is displayed to users before connecting to the share.
– guest ok Allows access to the guest account. Be careful using this, because it basically bypasses all security
settings. This parameter is required on some administrative shares though.
– browseable Allows browse access to shares, which means that users can navigate through the share
structure to see items available in the share. Make sure to disable on the [home] share.
Definition of the [homes] shares
Configuring File and Directory Sharing :
[share_name]
comment = Fred's Home Directory
path = /home/fred
valid users = fred
public = no
writable = yes
printable = no
Definition of the[printer] Shares
Configuring Printer Sharing
[printer_share_name]
comment = Fred's Printer
valid users = fred
path = /var/spool/samba
printer = freds_printer
public = no
writable = no
printable = yes.
Using Samba Users
• When the security = user setting is used, you
need to create two accounts to enable access
to shared files and directories:
– A Linux account that has the appropriate Linux
permissions on the share.
– A Samba account that has a name that matches the
Linux account and on which the SMB-compatible
NTLM password is set.
• on a Samba server, you’ll only have Samba-only
users who need to access it.
Samba-only users
• Samba-only users are user accounts that are used by Windows
users who are connecting to a Samba share but that do not
require login to a Linux terminal as well.
• For Samba-only users, you do not have to set a Linux password.
#gedit /etc/samba/smb.conf
or use
Or
mount -t cifs -o user=guest //192.168.122.200/data /mnt
SAMBA
• http://www.linuxfromscratch.org/blfs/view/cv
s/basicnet/nfs-utils.html
• https://docs.microsoft.com/en-us/previous-ve
rsions/windows/it-pro/windows-server-2012-
R2-and-2012/hh831795(v=ws.11)?
• rpcbind(8) - Linux manual page - man7.org
https://man7.org › linux
› man-pages › man8 › rpcbind.8
Assignment
• What is the problem with 139 port? Short
answer.
• What is FTPS ? And what is the difference
between SFTP vs FTPS?
• What is the relation between Port 111 in
Linux and Microsoft's port 135 or DCOM
DCE?