First, the 6 system and the 7 system are different
6 Start service as: Service name action
7 Start-up service: Systemctl Action Service Name
6 Service file path:/etc/rc.d/init.d/
7 Service file path:/usr/lib/systemd/system/
79120222 (The listening here is clear)
About mounts (problems previously encountered)
/etc/fstab (in this file, I added a permanent mount content, but can not open the machine, to the Grub menu)
Workaround:
1. Enter single-user mode
2. Permission to withdraw
3. Delete the added Mount content
4.mount-a (check if there are any errors)
5. Enter the system
DNS Domain name Resolution Service
Forward resolving the domain name-->IP address
Installation
[[email protected] ~]# yum install -y bind*[[email protected] ~]# rpm -ql bind/etc/NetworkManager/dispatcher.d/13-named/etc/logrotate.d/named/etc/named/etc/named.conf(主配置文件)/etc/named.iscdlv.key/etc/named.rfc1912.zones/etc/named.root.key/etc/portreserve/named/etc/rc.d/init.d/named(服务文件)/var/log/named.log(日志)
[[email protected] ~]# service named startStarting named: [ OK ]
[[email protected] ~]# vim /etc/named.confoptions { listen-on port 53 { any; }; 改 listen-on-v6 port 53 { any; }; 改 directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; allow-query { any; }; 改 recursion yes;
[[email protected] log]# vim /var/named/named.boke NS @ A 192.168.1.3www A 192.168.1.3 MX 5 mailftp A 192.168.1.3bbs CNAME ftpmail A 192.168.1.3
[[email protected] named]# service named restart(如果启动的慢,请执行rndc-confgen -a -r /etc/named.conf)Stopping named: . [ OK ]Starting named: [ OK ]
[[email protected] named]# vim /etc/resolv.conf #nameserver 1.1.1.1nameserver 192.168.1.4(改成自己ip)
[[email protected] named]# service iptables stopiptables: Setting chains to policy ACCEPT: filter [ OK ]iptables: Flushing firewall rules: [ OK ]iptables: Unloading modules: [ OK ]
[[email protected] named]# nslookup > www.boke.comServer: 192.168.1.3Address: 192.168.1.3#53Name: www.boke.comAddress: 192.168.1.3
Reverse resolve domain name <--IP address
[[email protected] log]# vim /etc/named.rfc1912.zoneszone "1.168.192.in-addr.arpa" IN { type master; file "named.192"; allow-update { none; };};[[email protected] log]# vim /var/named/named.192 NS boke.com.3 PTR boke.com.3 PTR www.boke.com.3 PTR mail.boke.com.3 PTR ftp.boke.com.3 PTR bbs.boke.com.
* (if you are using pseudo-instances, named.conf and namedrfc1912.zones must be the same)
DNS Master Secondary synchronization
Process is not added, just say a few points
1. The primary server only needs to be modified
[[email protected] named]# vim /etc/named.rfc1912.zoneszone "youjian.com" IN { type master; file "youjian.com.zone"; allow-update { none; }; allow-transfer { 192.168.10.13 ;}; };zone "10.168.192.in-addr.arpa" IN { type master; file "named.192.168.10"; allow-update { none; }; allow-transfer { 192.168.10.13 ;}; };
2. From the server only need to change
[[email protected] slaves]# vim /etc/named.rfc1912.zoneszone "youjian.com" IN { type slave; file "slaves/youjian.com.zone"; masters { 192.168.10.15; };};zone "10.168.192.in-addr.arpa" IN { type slave; file "slaves/named.192.168.10"; masters { 192.168.10.15; };};
3. Verification
[[email protected] slaves]# pwd/var/named/slaves[[email protected] slaves]# lltotal 8-rw-r--r--. 1 named named 370 Apr 26 21:19 named.192.168.10(有这两个文件,基本上就同步成功了,这不是手动创建的,可以看日志看看是不是同步过来的)-rw-r--r--. 1 named named 369 Apr 26 21:19 youjian.com.zone
* (note file permissions.) Firewall and SELinux must be turned off, this is just an experiment, if you want to turn on the firewall, configure firewall rules, if you want to turn on SELinux please download the log tool to resolve the security context. Finally, it should be stressed that as long as you modify the pseudo-instance of any file, please ensure that both sides of the file consistent)
FTP Service
Https://www.jianshu.com/p/e811421a76e2 (the principle here)
Experiment started.
1. Server
yum install -y vsftpd (服务端安装此软件)service vsftpd start (启动服务即可)
2. Client
yum install -y lftp(客户端安装此软件)lftp 192.168.10.15 (匿名连接,默认有下载权限)
3. Anonymous client commands
Ls (view files under the/var/ftp/pub directory on the server)
! LS (view files/directories in the local current directory)
Get + file name (download a piece from the server)
Put + file name (upload files from local to server)
4. If the file is not uploaded
(1) Check the server master configuration file
[[email protected] pub]# vim /etc/vsftpd/vsftpd.conf# obviously need to create a directory writable by the FTP user.anon_upload_enable=YES (将此命令打开)
(2) Check/var/ftp/pub's permissions to other people
drwxr-xrwx. 2 root root 4096 Apr 26 22:22
(3) Turn off SELinux or download the Log analysis tool
setenforce 0yum install -y setroubl*
System User Login Ftpbr/> Login
lftp+ User name @ server IP
Discovery can be switched to/(unsafe)
Modifying the master configuration file
[[email protected] boke]# vim /etc/vsftpd/vsftpd.conf#chroot_local_user=YES (yes=所有人都不能切换到/)#chroot_list_enable=YES (yes=有例外)# (default follows)#chroot_list_file=/etc/vsftpd/chroot_list (例外的用户文件存放位置,里面一行一个用户即可)重启服务
Root Login FTP
[[email protected][email protected][email protected]:~> ls`ls‘ at 0 [Delaying before reconnect: 26] (root权限太大了!!为了安全,root默认是不能远程操作机器的)
How do I make root work?
/etc/vsftpd/chroot_list (这里也要加上root,就是有例外,让root登录)/etc/vsftpd (这个目录下面修改两个文件,ftpusrs和user_list“将这两个文件里面的root删除即可”。不建议这么做,实验而已)
NFS Services
http://blog.51cto.com/atong/1343950 (here is the principle of writing very detailed)
NFS configuration is simple across systems
The server only needs to be installed
yum install -y rpcbind nfs-utilsvim /etc/exports/tmp 192.168.10.13(rw) (可以写网段,可修改权限)
The client only needs to install
Yum Install-y nfs-utils
SHOWMOUNT-E 192.168.10.15 (server IP)
Mount 192.168.10.15:/tmp//mnt (Mount remote directory)
Mount Df-h (view mount information)
Umount (Uninstall. Can no longer be uninstalled under Mount directory)
* (6 system and 7 system between the same user operation will occur problems, 6 system identification Uid,gid Judge users.) And the 7 system will not recognize---this is in 6 as a server, 7 for the client, and vice versa. The main impact is the operation of the client)
AutoFS Auto Mount
Software name AutoFS
[[email protected]/]# vim/etc/auto.master/mnt/etc/boke[[email protected]/]# VIM/ETC/BOKETEST-RW 192.168.10.15:/tmp[[email protected]mnt]# mkdir Test (must first create the file) [[email protected]/]# Service AutoFS restart[[email protected]~]# LS/MNT/TEST/1 shells4913 slave-boke5036 slave-boke~5159 slave-bokz~5282 Virtual-dingxuan. Ndjngd_cafenv-appconfig_ Virtual-dingxuan. Njkvbvkeyring-ilsjat Virtual-dingxuan. O4gtbimaster-boke Virtual-dingxuan. o7pwvamaster-boke~ virtual-dingxuan.qo27h9master-bokz~ Virtual-dingxuan. Txxj43orbit-dingxuan VMWARE-DINGXUANORBIT-GDM VMWAREDNDPULSE-0WHQUH25QUSD vmware-rootpulse-u2cdcuhjsrdp y Um_save_tx-2018-04-26-21-49fnytgu.yumtx
Samba Services
1. Server
yum install -y samba samba-commonservice nmb startservice smb startsmbpasswd -a boke(第一次为用户创建密码必须加-a选项,这个密码不是用户本身的密码,而是samba里面的密码)[[email protected] samba]# vim /etc/samba/smb.conf [gusts] comment = Public Stuff path = /var/lib/samba/gusts (这个文件路径可以随便,但要满足权限,就是说gusts文件的拥有者和所属组属于来宾:nobody) public = yes writable = yes printable = no
2. Client
yum install -y samba-clientsmbclient -L 192.168.10.13 (匿名查看,如果ls出错,请检查主配置文件,打开相应的布尔值,一个匿名读或读写的布尔值)smbclient -L 192.168.10.13 -U boke (使用用户查看,如果ls出错,请检查主配置文件,打开相应的布尔值,一个包含家目录的布尔值)smbclient //192.168.10.13/boke -U boke (使用用户登录)
3. Client commands
get+ file name (download)
put+ file name (upload) (if not uploaded here, first exclude the main configuration file, Ugo, hidden permissions, ACLs, special permissions.) Last SELinux)
Mount Samba
Mount-t cifs//192.168.10.13/gusts/mnt-o Username=boke (Specify file system cifs with option Mount)
Permanently mount Samba
[email protected] mnt]# Vim/etc/fstab
192.168.10.13/gusts/mnt CIFS cred=/etc/samba-gusts.txt 0 0
[email protected] mnt]# vim/etc/samba-gusts.txt
Username= User Name
password= Password
[email protected] mnt]# mount-a
All right, let's get here today.
Linux basic Services (i)