I. Basic network configuration
setup 永久网络设置 (IP 网关 DNS)vim /etc/sysconfig/network-scripts/ifcfg-eth0 (网卡信息文件)route -n 查看网关设置DNS vim /etc/resolv.connameserver 114.114.114.114netstat -an 查看网络状态 netstat -rn 查看网关netstat -tlun t tcp u udp l listen 查看tcp和udp协议监听端口netstat -an | grep ESTABLISHED | wc -l 查看连接数网络复制 scp linux <-> linuxscp [email protected]:/root/httpd-2.2.29.tar.gz /root/ 下载文件scp -r [email protected]:/root/httpd-2.2.29/ /root/ 下载目录scp httpd-2.2.29.tar.gz [email protected]:/root/bbs/ 上传文件scp -r httpd-2.2.29 [email protected]:/root/bbs/
FTP Server configuration (file upload download)
Server Setup Preparation: 1. Software preparation vsftpd-2.2.2-21.el6.i686.rpm ISO 2. Principle 21 Port Command transfer 20 port data transfer 3. User 1) System User upload directory/home/username hostname: IP user name: System User password: System user password port: 21 2) anonymous user anonymous/ftp download directory/var/ftp/pub hostname: IP user name: null password: null port: 21 Service Build steps: 1. Install the Software Yum-y Install VSFTPD 2. Modify the configuration file vim/etc/vsftpd/vsftpd.conf ftpd_banner= Welcome to 183PHP blah FTP service. 3. Turn on the service test shut down the firewall setup shutdown selinux vim/etc/selinux/config selinux=d Isabled reboot service vsftpd start Start Services Netstat-tlun view Port 21 test: 1 . Windows anonymous user ftp://192.168.183.251 can only download system users ftp://[email protected] Upload Download 2. Third-party tools FileZilla Anonymous user Login System User Login FTP experiment: Restrict user's home directory 1. Modify the configuration file vim/etc/vsftpd/vsftpd.conf Chroot_local_user =yes 2. Restart Service Test Service vsftpd restart test FileZilla Dasheng login test
Three. Samba File sharing Service
Intranet usage Principle: SMBD provides network resource access TCP 139 445 NMBD NetBIOS hostname resolution UDP 137 138 Samba service Build: 1. Software Installation yum-y Install Samba experiment 1: Share directory on Linux systems 1. Modify the configuration file Vim/etc/samba/smb . conf 101 Security = Share 263 [www] comment = public 265 Path =/www 266 browseable = yes 267 guest OK = yes 268 writable = yes 2. Establish/www directory mkdir/www chmod 777/www 3. Turn on Service Test services SMB St Art service NMB start test \\192.168.183.251 Setup Mapping Experiment 2 shared/pub directory/soft directory security level user 1. Modify Configuration file vim/etc/samba/smb.conf 101 Security = User 263 [pub] comment = P Ublic 265 Path =/pub 266 browseable = yes 267 writable = yes 269 [sof T] Comment = Public 271 Path =/soft 272 browseable = yes 273 writable = yes 2. Create directory mkdir/pub mkdir/soft chmod 777/pub chmod 700/soft useradd AA p ASSWD AA Chown aa/soft 3. Add Samba user smbpasswd-a AA smbpasswd-a Dasheng pdbedit -L View Samba users 4. Restart Service Test Services SMB Restart service NMB restart Test: Windows Dasheng login \\19 2.168.183.251 Delete Cache net use */del AA login \\192.168.183.251
"Linux" Network applications