Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ftp File and Print Server

Similar presentations


Presentation on theme: "Ftp File and Print Server"— Presentation transcript:

1 Ftp File and Print Server

2 What is samba Samba is a popular freeware program that allows end users to access and use files, printers, and other commonly shared resources on a company's intranet or on the Internet. Samba is often referred to as a network file system and can be installed on a variety of operating system platforms, including: Linux, most common UNIX platforms, OpenVMS, and OS/2.

3 General Samba Server Configuration
yum install samba samba-commons cups-libs chkconfig smb on chkconfig nmb on service smb restart service nmb restart

4 Configure smb.conf file
#============ Global Settings==================# [global] workgroup = WORKGROUP Security = share #============ Share Definitions =================# [SambaShare] path = /samba/share valid users guest ok = no writable = yes browsable = yes

5 Configure Samba Users useradd smbuser groupadd smbgrp
Add the user to samba group usermod -a -G smbgrp smbuser smbpasswd -a smbuser

6 Create Share folder and Set Permissions for Samba Users
cd /samba/ mkdir share chown -R smbuser:smbgrp share/ chmod -R 0770 share/ vi /etc/selinux/config SELINUX=disabled iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT service iptables save service smb restart service nmb restart

7 Samba swat Samba service can provides files haring and printing services to its clients. System administrator can install SWAT in order to configure samba and perform samba administration from the web browser. You just need to install xinetd together with samba-SWAT software. ~]# yum install samba-swat xinetd -y

8 Add 192.168.0.0/24 network and enable swat by set ‘disable’ to ‘no’.
# default: off # description: SWAT is the Samba Web Admin Tool. Use swat \ # to configure your Samba server. To use SWAT, \ # connect to port 901 with your favorite web browser. service swat { port = 901 socket_type = stream wait = no only_from = /16 user = root server = /usr/sbin/swat log_on_failure += USERID disable = no } 4. Start the xinetd service : ~]# service xinetd start Access to [ IP address):901] and enter root login password.

9 NFS Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a computer network much like local storage is accessed.

10 NFS Server Configuration
Install NFS in Server yum install nfs* -y /etc/init.d/nfs start chkconfig nfs on Install NFS in Client

11 Create shared directories in server
~]# mkdir /home/ostechnix ~]# chmod 755 /home/ostechnix/ Export shared directory on server ~]# vi /etc/exports /home/ostechnix /24(rw,sync,no_root_squash,no_all_squash) ~]# /etc/init.d/nfs restart

12 Mount shared directories in client
client]# mkdir -p /nfs/shared client]# mount -t nfs :/home/ostechnix/ /nfs/shared/

13 ~]# vi /etc/sysconfig/nfs # # Define which protocol versions mountd  # will advertise. The values are "no" or "yes" # with yes being the default #MOUNTD_NFS_V2="no" #MOUNTD_NFS_V3="no" # # # Path to remote quota server. See rquotad(8) #RQUOTAD="/usr/sbin/rpc.rquotad" # Port rquotad should listen on. RQUOTAD_PORT=875 # Optinal options passed to rquotad #RPCRQUOTADOPTS="" # # # Optional arguments passed to in-kernel lockd #LOCKDARG= # TCP port rpc.lockd should listen on. LOCKD_TCPPORT=32803 # UDP port rpc.lockd should listen on. LOCKD_UDPPORT=32769 # # # Optional arguments passed to rpc.nfsd. See rpc.nfsd(8) # Turn off v2 and v3 protocol support #RPCNFSDARGS="-N 2 -N 3" # Turn off v4 protocol support #RPCNFSDARGS="-N 4" # Number of nfs server processes to be started. # The default is 8.  #RPCNFSDCOUNT=8 # Stop the nfsd module from being pre-loaded #NFSD_MODULE="noload" # Set V4 grace period in seconds #NFSD_V4_GRACE=90 # # # # Optional arguments passed to rpc.mountd. See rpc.mountd(8) #RPCMOUNTDOPTS="" # Port rpc.mountd should listen on. MOUNTD_PORT=892 # # # Optional arguments passed to rpc.statd. See rpc.statd(8) #STATDARG="" # Port rpc.statd should listen on. STATD_PORT=662 # Outgoing port statd should used. The default is port # is random STATD_OUTGOING_PORT=2020 # Specify callout program  #STATD_HA_CALLOUT="/usr/local/bin/foo" # # # Optional arguments passed to rpc.idmapd. See rpc.idmapd(8) #RPCIDMAPDARGS="" # # Set to turn on Secure NFS mounts.  #SECURE_NFS="yes" # Optional arguments passed to rpc.gssd. See rpc.gssd(8) #RPCGSSDARGS="" # Optional arguments passed to rpc.svcgssd. See rpc.svcgssd(8) #RPCSVCGSSDARGS="" # # To enable RDMA support on the server by setting this to # the port the server should listen on #RDMA_PORT=20049Now restart the NFS service

14 ~]# vi /etc/sysconfig/iptables # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter -A INPUT -m state --state NEW -m udp -p udp --dport j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT

15 root@server ~]# service iptables restart
client]# mount -t nfs :/home/ostechnix/ /nfs/shared/ client]# mount shared]# mkdir test shared]# touch file1 file2 file3 ~]# cd /home/ostechnix/ ostechnix]# ls file1  file2  file3  test ostechnix]#

16 Cups Configuration Basic
CUPS (formerly an acronym for Common UNIX Printing System) is a modular printing system for Unix-like computer operating systems which allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer.

17 Install Cups [root@dlp ~]# vi /etc/cups/cupsd.conf # line 18: change
Listen 631 # line 31: add access permition <Location />    Order allow,deny    Allow /24 </Location>

18 # line 37: add access permition
<Location /admin>    Order allow,deny    Allow /24 </Location> # line 43: add access permition <Location /admin/conf>    AuthType Default    Require    Order allow,deny    Allow /24 # add at the last: specify certificates ServerCertificate /etc/pki/tls/certs/server.crt ServerKey /etc/pki/tls/certs/server.key ~]# /etc/rc.d/init.d/cups start  Starting cups: [ OK ] ~]# chkconfig cups on 

19 Access to " server's hostname or IP address):631/" with web browser and Click "Adminstration"-"Add Printer".

20 FTP Principle The File Transfer Protocol (FTP) is a standard network protocol used for the transfer of computer files from a server to a client using the Client–server model on a computer network.

21 Configuration of FTP Server
~]# yum -y install vsftpd ~]# vi /etc/vsftpd/vsftpd.conf # line 12: no anonymous anonymous_enable=NO # line 81,82: uncomment ( allow ascii mode ) ascii_upload_enable=YES ascii_download_enable=YES # line 96,97: uncomment ( enable chroot ) chroot_local_user=YES chroot_list_enable=YES # line 99: uncomment ( specify chroot list ) chroot_list_file=/etc/vsftpd/chroot_list # line 105: uncomment ls_recurse_enable=YES # add follows to the end # specify root directory ( if don't specify, users' home directory become FTP home directory) local_root=public_html # use localtime use_localtime=YES

22 [root@www ~]# vi /etc/vsftpd/chroot_list
# add users who are not applied with chroot cent ~]# /etc/rc.d/init.d/vsftpd start  Starting vsftpd for vsftpd: [  OK  ] ~]# chkconfig vsftpd on Open the port 21 from firewall Use filezilla to transfer file


Download ppt "Ftp File and Print Server"

Similar presentations


Ads by Google