<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>编程技巧分享</title><link>https://www.lpp521.com/</link><description>天天BUG话编程</description><item><title>windows截图</title><link>https://www.lpp521.com/?id=66</link><description>&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;一&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;、上帝截图键&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;PrtScr/SysRq&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;，&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;截取大小为全屏，可以截取鼠标右键菜单。&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;按过此键后无任何提示，直接在需要的地方粘贴就可以了。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729688621545299.png&quot; title=&quot;图片1.png&quot; alt=&quot;图片1.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;二&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;、&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;lt + PrtScr/SysRq&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;，&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;截取活动窗口。不能截取鼠标右键菜单。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;三&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;、&lt;/span&gt;windows自&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;带&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;截图工具&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;win10/11 点击开始图标，找到截图和草稿，再点击左上角的新建按钮，即可截图，默认复制到剪切板，粘贴即可。此软件可以设置截图快捷键，点击右上角三个点，进入设置，点击 使用PrtScn按键打开屏幕截图，会跳转的系统设置，往下翻，找到 屏幕截图快捷方式，打开即可。下次截图就可以按键盘上的&lt;span style=&quot;font-family: 宋体; font-size: 16px; text-wrap: wrap;&quot;&gt;PrtScr/SysRq键快速截图&lt;/span&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729688908842238.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729689042187352.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729689062861306.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;win7在开始菜单、附件里可以找到，如图&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729688675190096.png&quot; title=&quot;图片3.png&quot; alt=&quot;图片3.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;打开后，默认新建截图文件，图示十字标，框选要截图的内容&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729688747803479.png&quot; title=&quot;图片2.png&quot; alt=&quot;图片2.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;四&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;、登陆&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;QQ，截图&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;快捷键&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;为&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;Ctrl+Alt+A&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;五&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:16px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;、登陆微信，截图快捷键为&lt;/span&gt;Alt+A&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729688780612925.png&quot; title=&quot;图片4.png&quot; alt=&quot;图片4.png&quot;/&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2024 21:03:22 +0800</pubDate></item><item><title>linux的关机与重启</title><link>https://www.lpp521.com/?id=60</link><description>&lt;p&gt;shutdown -h now&amp;nbsp; --立即关机&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;shutdown -h 10:53&amp;nbsp; --到10:53关机，如果该时间小于当前时间，则到隔天&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;shutdown -h +10&amp;nbsp; --10分钟后自动关机&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;shutdown -r now&amp;nbsp; --立即重启&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;shutdown -r +30 &amp;#39;The System Will Reboot in 30 Mins&amp;#39;&amp;nbsp; &amp;nbsp;--30分钟后重启并并发送通知给其它在线用户&lt;/p&gt;&lt;p&gt;reboot&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;text-wrap: wrap;&quot;&gt;--立即重启&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: wrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;Linux系统关闭最简单的解决方案，就是使用通过终端发送的关机指令来进行关机操作，这可以用来长久关闭主机直到重新启动。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;该命令为：shutdown [option] [time] [message]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;例如，要立即关闭主机，可以使用：shutdown -h now&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;这里，-h表示暂停，而now明确表示该指令应立即执行。可以使用不同的延迟，例如，可以使用+9代替，这将告诉主机在9分钟内运行关机程序。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;如果想包含一条信息，这条信息将会显示给所有已登录的用户：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;shutdown -h +9 &amp;quot;服务器正在关闭，请保存的工作并注销。&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;Shutdown scheduled for 时间信息 CST, use &amp;#39;shutdown -c&amp;#39; to cancel.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;另一种选择是使用-r命令重新启动计算机。 这用于代替-h，因此要重新启动主机，先找到这些命令的开关的完整列表，输入：[command] –help，然后用-r重新启动。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;可以通过输入shutdown -c命令取消任何计划的关闭或重新启动：shutdown –c&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2、重新启动&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;标准的重启命令是：reboot，这将提示主机自动关闭，然后再重新打开。然而，如果想关掉设备，那么-p便是进行开关工作：reboot –p。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;另一种选择是强制重启。如果应用程序或服务正在挂起，而需要快速重启，-f命令将非常有用：reboot –f，这将强制重新启动主机。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3、定时关机&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;除了使用-f命令强制关机外，还可以使用-w开关将系统重启调用记录到/var/log/wtmp。这是一个潜在有用的调试工具，就像-verbose一样，它可以帮助解决关机问题。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: wrap;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2024 20:22:33 +0800</pubDate></item><item><title>vsftp安装配置及一些问题</title><link>https://www.lpp521.com/?id=57</link><description>&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;FTP的PORT(主动模式) 和 FTP的PASV(被动模式)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;PORT（主动模式）&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;PORT中文称为主动模式，工作的原理： FTP客户端连接到FTP服务器的21端口，发送用户名和密码登录，登录成功后要list列表或者读取数据时，客户端随机开放一个端口（1024以上）， 发送 PORT命令到FTP服务器，告诉服务器客户端采用主动模式并开放端口；FTP服务器收到PORT主动模式命令和端口号后，通过服务器的20端口和客户端 开放的端口连接，发送数据&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;在主动模式下，&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP客户端从任意端口5150（端口号&amp;gt;1023）发起一个FTP请求，并携带自己监听的端口号5151（发送的端口号+1=监听端口号）；随后服务器返回确认，然后从服务器本地的20端口主动发起连接请求到客户端的监听端口5151，最后客户端返回确认。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;这种模式缺点在于服务器带客户端的&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP连接很容易被传输过程中的路由器、防火墙所影响或拦截。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;PASV（被动模式）&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;PASV是Passive的缩写，中文成为被动模式，工作原理：FTP 客户端连接到FTP服务器的21端口，发送用户名和密码登录，登录成功后要list列表或者读取数据时，发送PASV命令到FTP服务器， 服务器在本地随机开放一个端口（1024以上），然后把开放的端口告诉客户端， 客户端再连接到服务器开放的端口进行数据传输&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;为了主动模式所面临的服务器到客户端的连接会被拦截阻塞的问题，&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP发展出了被动模式。在被动模式中，命令连接和数据连接都由客户端来发起，这样就可以解决从服务器到客户端的数据端口的入方向连接被防火墙拦截的问题。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;客户端用随机命令端口&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;5150向服务器的21命令端口发送一个PASV请求，然后服务器返回数据端口3267，告诉客户端我在哪个端口监听数据连接。然后客户端向服务器的监听端口3268发起数据连接，最后服务器回复确认ok。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;查看是否安装：&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;rpm -qa | grep vsftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;安装：&lt;/span&gt;y&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;um -y install vsftpd&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;启动：&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;systemctl start vsftpd&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;重启：&lt;/span&gt;system&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ctl restart vsftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;查看开机启动：&lt;/span&gt;s&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ystemctl is-enabled vsftpd &lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;或&lt;/span&gt; system&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ctl list-unit-files | grep vsftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;开机启动：&lt;/span&gt;s&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;ystemctl enable vsftpd&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family:等线&quot;&gt;或&lt;/span&gt; &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;chkconfig vsftpd on&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;查看状态：&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;systemctl status vsftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;查看&lt;/span&gt;21端口是否存在：&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;netstat -nltp | grep 21&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;添加防火墙：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;##启用ftp服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;fir&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ewall-cmd –permanent –zone=public –add-service=ftp&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;##增加ftp访问&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;firewall-cmd --add-port=10000-11000/tcp –permanent&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;##上述命令，开放10000-11000号的tcp端口&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;（被动访问端口）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;##如果有需要可以增加相应的udp端口&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;firewall-cmd –reload&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;##重新加载防火墙&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;设置&lt;/span&gt;S&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;EL&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;inux&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;查看当前设置&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;getsebool&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;-a&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&amp;nbsp;| grep ftp&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;修改&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;sebool -P ftpd_anon_write off&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;s&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;etsebool –P ftpd_full_access on&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;临时关闭（非必要）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;setenforce&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;完全关闭（非必要）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vi&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;/etc/selinux/config&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;修改&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;SELINUX=&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;disabled&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;创建&lt;/span&gt;F&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;TP&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;用户&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;add ftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;设置密码&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;passwd&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;限制该用户只能访问&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;，不能直接登录服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;mod -s /sbin/nologin ftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;创建&lt;/span&gt;F&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;TP&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;文件存储路径&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;mkdir /home/www -p &lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;创建主目录，不可上传文加&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;mkdir /home/www/html&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;文加存储目录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;设置访问权限&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;chmod&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;a-w /home/www &amp;amp;&amp;amp; chmod 777 -R /home/www/html&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;修改配置&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;先备份，&lt;/span&gt;cp&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;/etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vim&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/vsftpd/vsftpd.conf&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;单用户&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;loca&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;l_root=/home/www&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;针对系统用户的存储根目录&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anon_root=/home/www&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;针对匿名用户的存储跟目录（如果禁用匿名用户，此项不用设置）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;chroot&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_local_user=YES&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;限定用户在个人目录内访问&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anonymous_enable=NO&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;禁止匿名用户&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;listen=&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;listen&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_ipv6&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;NO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;多用户独立配置（如果多用户公用一个根目录，跳过此步）&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;先创建用户，为每个用户建立自己的根目录&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;创建用户配置目录&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;mkdir &lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/vsftpd/userconfig&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vim /etc/vsftpd/vsftpd.conf&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;user_config_dir=/etc/vsftpd/userconfig&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;为不同的用户添加自己的配置&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vim /etc/vsftpd/userconfig/&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;用户名&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;local_root=&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;用户根目录&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP默认的存储目录 /var/ftp/pub 默认不允许匿名用户上传&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;虚拟用户（需要一个本地用户来当虚拟用户的本地权限）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;创建虚拟用户&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vim&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc/vsftpd/vmusers&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;test1&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;虚拟用户名（不能有空格）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;123&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;密码&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;··&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;test2&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;第二个虚拟用户名&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;123&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;密码&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;test3&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;123&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;对用户名和密码进行哈希加密操作&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_load -T -t hash -f /etc/vsftpd/vmusers /etc/vsftpd/vmusers.db&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;修改&lt;/span&gt;pam&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vim&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;/etc/pam.d/vmusersfile&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;account&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;required&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;pam_userdb.so&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;db=/etc/vsftpd/vmusers&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;auth&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;required&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;pam_userdb.so&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;db=/etc/vsftpd/vmusers&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;修改&lt;/span&gt;vsftpd&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;.conf&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vim&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/vsftpd/vdftpd.conf&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;pam_service_name=vmusersfiel&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;guest_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;guest_username=&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;本地用户名&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;vsftp 服务连接报530 login incorrect&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;一：解决方案一&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;查看&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;/etc/vsftpd/vsftpd.conf 查到 pam_service_name=vsftpd ，可知认证pam 文件位于 /etc/pam.d/vsftpd&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;查看&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;/etc/pam.d/vsftpd 看到一行 auth required pam_shells.so ,因为创建ftp账户时候，禁止了ssh登陆 所以此处应该改为 pam_nologin.so&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;重启&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;systemctl vsftpd.service restart ，可以正常登陆&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685987440928.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;二：解决方案二&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;通过修改配置文件解决了。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;总结了一下在搭建&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP服务器的时要注意的地方大概有下面这几点：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;（&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;1）首先==/etc/vsftpd/vsftpd.conf==的配置文件中匿名用户要打开&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anonymous_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;（&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;2）如果使用的是本地账号那么查看 /etc/vsftpd/ftpusers文件，该文件中所列出的用户名，都是不允许登录FTP服务器的，另外如果在 /etc/vsftpd/vsftpd.conf文件中开启了user_list即：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_deny=YES&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;那么还要查看&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;/etc/vsftpd/user_list文件，在该文件中出现的用户名也是不可登录的&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;但是若：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_deny=NO&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;则不是&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;user_list 的问题&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;（&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;3）如果是用ftp虚拟用户登录的时候出现该错误，那么原因一般有下面几个方面：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;①检查自己的虚拟用户数据库内容是否有误&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;②可能是&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;PAM模块有问题检查自己的 /etc/pam.d/vsftpd文件的内容&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;③虚拟用户验证&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP服务因为需要用到PAM模块，所以本地用户有可能被PAM模块限制而导致无法登陆&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;我所出现的问题就是第三种，我的&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;PAM模块的vsftpd文件是这样写的&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;auth&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;required&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;pam_userdb.so &amp;nbsp;db=/etc/vsftpd/vuser&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;account&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;required&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;pam_userdb.so &amp;nbsp;db=/etc/vsftpd/vuser&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;所以在&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;PAM认证的时候只会识别我在虚拟用户数据库里面添加的虚拟用户，而本地用户不在数据库里面，所以当我用本地用户登录时，就一直报530这个错误了&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;三：方案三&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;今天遇到一个主机，&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;RHEL6.6的系统，vsftp服务是运行的，但是用户输入正确的密码登录会报530的错误，无法登录成功。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;使用&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FlashFXP报错如下&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;在本机使用&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ftp客户端登录报错如下：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;问题分析：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;1、先检查&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vsftpd的配置文件是否正常。检查了/etc/vsftpd目录，以及vsftpd.conf配置文件。查看后无异常&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;查看&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc/vsftpd/user_list和/etc/vsftpd/ftpusers文件中，也没有限制登录的帐号。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;2、这时，想到可能是&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;pam模块的问题。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;于是，看了下&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc/vsftpd/vsftpd.conf文件中的相关配置，是启用pam的&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;然后查看&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc/pam.d下的vsftpd文件了，发现有两个文件&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;分别查看了下文件里的内容&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;问题来了，&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vsftpd里的内容是不对的，应该是vsftpd.bak里的内容才是正确的。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;这样就很简单了，把&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc/pam.d/vsftpd的内容恢复。执行service vsftpd restart重启一下vsftp服务，再测试登录的时候，就正常了。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;vsftpd中关于ftpusers和user_list两个文件的说明以及vsftpd.conf中的userlist_enable和userlist_deny两个配置项的解释&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;一：&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ftpusers和user_list两个文件各自的用途是什么？有何关系？&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;首先请明确一点：&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ftpusers不受任何配制项的影响，它总是有效，它是一个黑名单！&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;该文件存放的是一个禁止访问&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;FTP的用户列表，通常为了安全考虑，管理员不希望一些拥有过大权限的帐号（比如root)登入FTP，以免通过该帐号从FTP上传或下载一些危险位置上的文件从而对系统造成损坏。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;而&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;user_list则是和vsftpd.conf中的userlist_enable和userlist_deny两个配置项紧密相关的，它可以有效，也可以无效，有效时它可以是一个黑名单，也可以是一个白名单！那么是什么的设置决定了它的作用呢？这就是问题二要解释的。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;所以简单总结就是：&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ftpusers和user_list没有任何关系，ftpusers文件总是生效，user_list则取决于userlist_enable和userlist_deny两项配置。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;二：&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;vsftpd.conf中的userlist_enable和userlist_deny两个配置项各自起什么作用，两者如何搭配使用?&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;为了说明这个问题，我们来建立两个测试用户：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;tom: 在user_list中&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;jim:不在user_list中&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;然后我们分别给两个配置项取不同的值，分&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;4种Case进行测试：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Case 1: userlist_enable=YES, userlist_deny=YES&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;tom: 拒绝登入&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;jim: 允许登录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Case 2: userlist_enable=YES, userlist_deny=NO&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;tom: 允许登录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;jim:拒绝登录（如user_list文件开头的注释所述，甚至不会提示输入密码，即无登入提示框，直接拒绝连接）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Case 3: userlist_enable=NO,userlist_deny=NO&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;tom: 允许登录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;jim: 允许登录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Case 4: userlist_enable=NO,userlist_deny=YES&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;tom: 允许登录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;jim: 允许登录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;综上实验得出以下结论：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;1、&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_enable和userlist_deny两个选项联合起来针对的是：本地全体用户（除去ftpusers中的用户）和出现在user_list文件中的用户以及不在在user_list文件中的用户这三类用户集合进行的设置。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;2、当且仅当&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_enable=YES时：userlist_deny项的配置才有效，user_list文件才会被使用；当其为NO时，无论userlist_deny项为何值都是无效的，本地全体用户（除去ftpusers中的用户）都可以登入FTP&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;3、当&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_enable=YES时，userlist_deny=YES时：user_list是一个黑名单，即：所有出现在名单中的用户都会被拒绝登入；&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;4、当&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;userlist_enable=YES时，userlist_deny=NO时：user_list是一个白名单，即：只有出现在名单中的用户才会被准许登入(user_list之外的用户都被拒绝登入)；另外需要特别提醒的是：使用白名单后，匿名用户将无法登入！除非显式在user_list中加入一行：anonymous&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;配置文件&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;/etc/vsftpd/vsftpd.conf&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 等线;font-size: 14px&quot;&gt;匿名用户设置&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anonymous_enable=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;匿名登录&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anon_upload_enable=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;匿名上传&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anon&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_mkdir_write_enable=YES&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;匿名用户创建文件夹&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anno_other_write_ebable=YES &lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;匿名用户是否除了写权限是否拥有删除和修改的权限&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anno_world_readable_only=YES&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;匿名用户是否拥有只读权限&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;no_anno_password=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;匿名用户是否跳过密码检测&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anno_umask=077&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;匿名用户创建文件的掩码权限&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;dir&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;message_enable=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;进入目录可以显示一些设定的信息，可以通过&lt;/span&gt;message&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_file=.message&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;来设置&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;lo&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;cal_enable=YES&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;本地用户访问，设置为&lt;/span&gt;N&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;O&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;，所以虚拟用户都将无法访问&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_enable=YES&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;写操作&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_umask=022&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;创建或上传后文件的权限掩码（默认的&lt;/span&gt;unask码，本地用户的掩码信息）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;hown_uploads=NO&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;禁止上传文加修改宿主&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;xferlog&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_enable=YES&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;开启日志&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;xferlog_file=/var/log/xferlog&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;日志路径，需要对日志文件授权&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;chown vsftpd.vsftpd /var/log/vsftpd.log&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;xferlog_std_format=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;标准的&lt;/span&gt;ftp&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;xferlog模式 &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;use&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_localtime=YES&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;使用系统时区&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;no&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;priv_user=vsftpd&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;禁止&lt;/span&gt;vsftpd账号登陆&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;async_abor_enable=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;异步传输功能&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;scii_upload_enable=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ASCII&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;模式的上传&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;scii_download_enable=YES&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ASCCI&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;模式的下载&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;ftpd_banner=Welcone to …&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;登录欢迎语&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;chroot_local_user=YES&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;限定用户在个人目录内访问&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;hroot_list_enable&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;配合下个参数&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;chroot_list_file=/etc/vsftpd/chroot_list&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;限定在个人目录内访问的用户信息列表&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;listren&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;=YES&lt;/span&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;以&lt;/span&gt;standalone方式启动（是否开启监听）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;lister&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_port=2121&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;修改连接端口&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;pa&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;m_service_name=vsftpd&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;/etc/pem.d/&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;下的&lt;/span&gt;vsftpd文件&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;list_enable=YES&lt;/span&gt; &amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;uest_enable=YES&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;启用虚拟用户功能&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;guest&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_username=vsftpd&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;虚拟用户权限所对应的宿主用户，宿主用户为系统用户&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;virtual_use_local_privs=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;虚拟用户的&lt;/span&gt;vsftpd配置文件存放路径&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_config_dir=/etc/vsftpd/vuser_conf&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;此目录里存放的文件名和虚拟用户名必须完全一致&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;connect&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_from_port_20=YES&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;主动连接的端口号&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;连接超时&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Idle&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;_session_timeout=300&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;会话空闲的中断时间、秒&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Data_&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;connection_timeout=60&lt;/span&gt; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;数据连接空闲的中断时间、秒&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Accept_&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;timeout=60&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;客户端空闲的中断事件、秒&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;Connect_timeout=30&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;客户端中断多长时间后自动激活连接、秒&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;限制最大连接数和传输速率&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;max_&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;client=100&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;最大客户端连接数，&lt;/span&gt;0表示不限制&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;max_per_ip=5&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;同一&lt;/span&gt;ip地址允许的最大客户端连接数，0不限制&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;local_max_rate&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;=500000&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;本地用户最大连接速率，&lt;/span&gt;0不限制，单位字节&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anon_&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;max_rate=200000&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;匿名用户最大连接速率，&lt;/span&gt;0不限制，单位字节&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:等线&quot;&gt;启用&lt;/span&gt;Passive模式&lt;/span&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;（被动模式）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#pasv_enable=YES ##启用&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#pasv_min_port=10000 ##开启最低的pasv端口，建议采用大于1024的高端口&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#pasv_max_port=11000 ##开启最高的pasv端口&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许匿名登录 FTP 服务器，默认设置为 YES 允许&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#用户可使用用户名 ftp 或 anonymous 进行 ftp 登录，口令为用户的 Email地址。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#入不允许匿名访问NO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;anonymous_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许本地用户（即linux系统中的用户账号）登录 FTP 服务器，默认设置为YES允许&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#本地用户登录后会进入用户主目录，而匿名用户登录后进入匿名用户的下载目录 /var/ftp/pub&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#若只允许匿名用户访问，前面加上#注释掉即可阻止本地用户访问 FTP 服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;local_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许本地用户对FTP服务器文件具有写权限，默认设置为 YES 允许&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;write_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#掩码，本地用户默认掩码为077&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#你可以设置本地用户的文件掩码为缺省022，也可根据个人喜好将其设置为其他值&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# local_umask=022&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许匿名用户上传文件，须将全局的 write_enable=YES。默认为YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#anon_upload_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许匿名用户创建新文件夹&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#anon_mkdir_write_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否激活目录欢迎信息功能&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#当用户用cmd模式首次访问服务器上某个目录是，FTP 服务器将显示欢迎信息&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#默认情况下，欢迎信息是通过该目录下的.message文件获得的&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#此文件保存自定义的欢迎信息，由用户自己建立&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#dirmessage_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否让系统自动维护上传和下载的日志文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#默认情况该日志文件为/var/log/vsftpd.log，也可以通过下面的xferlog_fill选项对其进行设定，默认值为NO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;xferlog_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否设定FTP服务器启用FTP 数据端口的连接请求&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#ftp-data 数据传输，21为连接控制端口&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;connect_from_port_20=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# 设定是否允许改变上传文件的属主，与下面一个设定项配合使用&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#注意，不推荐使用 root 用户上传文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#chown_uploads=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设置想要改变的上传文件的属主，如果需要，则输入一个系统用户名&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#可以把上传的文件root 属主。 whoerver：任何人&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#chown_username=whoerver&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设定系统维护记录FTP服务器上传和下载情况的日志文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#/var/log/vsftpd.log 是默认的，也可以另设其他&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#xferlog_file=/var/log/vsftpd.log&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否以标准xferlog 的格式书写传输日志文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#默认为 /var/log/xferlog，也可以通过xferlog_file 选项对其进行设定 ，默认值为 NO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#xferlog_std_format=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#以下是附加配置，添加相应的选项将启用相应的设置&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否生成两个相似的日志文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#默认在/var/log/xferlog 和 /var/log/vsftpd.log 目录下&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#前者是 wu_ftpd 类型的传输日志，可以利用标准日志工具对其进行分析，后者是 vsftpd类型的日志&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#dual_log_enable&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否想原本输出到/var/log/vsftpd.log中的日志，输出到系统日志&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#syslog_enable&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设置数据传输中断间隔时间，此语句表示空闲的用户会话中断时间为 600 秒&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#即当数据传输结束后，用户连接FTP服务器的时间不应超过600秒。可以根据实际情况对该值进行修改&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#idle_session_timeout=600&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设置数据连接超时时间，该语句表示数据连接超时时间为120秒，可根据实际情况对其值进行修改&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#data_connection_timeout=120&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#运行vsftpd需要的非特权系统用户，缺省是 nobody&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#nopriv_user=ftpsecure&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否识别异步ABOR 请求&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#如果FTP client 会下达 “async ABOR”这个指令时，这个设定才需要启用&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#而一般此设定不安全，所以通常将其取消&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#async_abor_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否以ASCII方式传输数据。默认情况下，服务器会忽略ASCII方式的请求。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#启用此选项将允许服务器以ASCII方式传输数据&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#不过，这样可能会导致由&amp;quot;SIZE /big/file&amp;quot;方式引起的DoS攻击&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#ascii_upload_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#ascii_download_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#登录FTP服务器时显示的欢迎信息&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#如有需要，可在更改目录欢迎信息的目录下创建名为.message 的文件，并写入欢迎信息保存后&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#ftpd_banner=Welcome to blah FTP service&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# 黑名单设置。如果很讨厌某些 email address，就可以使用此设定来取消它的登录权限&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#可以将某些特殊的 email address 抵挡住&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# deny_email_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#当上面的 deny_email_enable=YES时，可以利用这个设定想来规定哪些邮件地址不可登录vsftpd服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#此文件需用户自己创建，一行一个 email address 即可&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#banned_email_file=/etc/vsftpd/banned_emails&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# 用户登录FTP服务器后是否具有访问自己目录以外的其他文件的权限&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设置为 YES时，用户被锁定在自己的home目录中，vsftpd 将在下面 chroot_list_file 选项值的位置寻找 chroot_list 文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#必须与下面的设置项配合&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#chroot_list_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#被列入此文件的用户，在登录后将不哼切换到自己目录以外的其他目录&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#从而有利于 FTP 服务器的安全管理和隐私保护。此文件需自己建立&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#chroot_list_file=/etc/vsftpd/chroot_list&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许递归查询。默认为关闭，以防止远程用户造成过量的 I/O&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#ls_recurse_enable=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许监听&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#如果设置为YES，则vsftp将以独立模式运行，由vsftpd自己监听和处理IPv4端口的连接请求&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;listen=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设定是否支持IPv6.如要同时监听 IPv4 和IPv6 端口，则必须运行两套vsftpd，采用两套配置文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#同时确保其中有一个监听选项是被注释掉的&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#listen_ipv6=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设置PAM外挂模块提供的认证服务所使用的配置文件名，即/etc/pam.d/vsftpd 文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#此文件中 file=/etc/vsftpd/ftpusers 字段，说明了 PAM模块能抵挡的账号内容来自文件/etc/vsftpd/ftpusers 中&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#pam_service_name=vsftpd&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否允许 ftpusers 文件中的用户登录 FTP 服务器，默认为 NO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#若此项设为 YES，则 user_list文件中的用户允许登录 FTP 服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#而如果同时设置了 userlist_deny=YES，则user_list文件中的用户将不允许登录 FTP 服务器，甚至连输入密码提示信息都没有&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#userlist_enable=YES/NO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#设置是否阻止user_list文件中的用户登录FTP服务器，默认为 YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#userlist_deny=YES/NO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#是否使用 tcp_wrappers 作为主机访问控制方式。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#tcp_wrappers可以实现linux 系统中网路服务的基于主机地址的访问控制&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#在/etc目录中的 hosts.allow 和 hosts.deny 两个文件用于设置 tcp_wrappers 的访问控制&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;#前者设置允许访问记录，后者设置拒绝访问记录。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# 如想限制某些主机对FTP服务器192.168.57.2的匿名访问，编缉/etc/hosts.allow文件，如在下面增加两行命令：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# vsftpd:192.168.57.1:DENY 和vsftpd:192.168.57.9:DENY&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# 表明限制IP为192.168.57.1/192.168.57.9主机访问IP为192.168.57.2的FTP服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;# 此时FTP服务器虽可以PING通，但无法连接&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:等线;font-size:14px&quot;&gt;tcp_wrappers=YES&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2024 20:19:06 +0800</pubDate></item><item><title>linux挂载U盘</title><link>https://www.lpp521.com/?id=55</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1、首先使用命令：fdisk -l，查看系统硬盘和分区情况。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2、插入U盘，再次用fdisk -l命令查看，并确认自己的U盘。此时笔者的系统中多了一个硬盘/dev/sdb和它的一个分区/dev/sdb1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3、使用命令：mkdir -p /mnt/usb，在mnt目录下创建目录usb来作挂接点。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;4、挂载U盘，使用命令：mount -o iocharset=cp936 /dev/sdb1 /mnt/usb&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;其中，-o iocharset是设定字符集，保证能够正常显示中文&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;5、成功挂载后，可以使用命令：ls /mnt/usb进行查看U盘中的内容。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;6、解除挂载，目的是避免损坏或丢失数据，使用命令:umount /dev/sdb1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;(ps:挂载移动硬盘和U盘完全一样,解除挂载时要记得退出挂载U盘的目录，也就是上面的/mnt/usb目录。)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;…………………………………………………………………………………………&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;※挂载不成功的解决办法※&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1：当挂载不成功时，如出现如下报错的提示：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;mount: unknown filesystem type &amp;#39;ntfs&amp;#39;---未知的文件系统类型‘ntfs’&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2：因ntfs不是Linux的文件系类型，我们可安装一个工具包：ntfs-3g。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3：ntfs-3g下载时注意按照自己的系统版本软件架构下载对应的二进制RPM包，以免安装完了，挂载出错。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;4：将安装包上传到系统中，只需： yum -y install ntfs-3g-2017.3.23-6.el7.x86_64.rpm 一条命令就安装好了；然后再按照上面的步骤就可以成功挂载到U盘了。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2024 20:17:34 +0800</pubDate></item><item><title>centos 配置邮箱</title><link>https://www.lpp521.com/?id=41</link><description>&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;1.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;安装&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;mail&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;检查&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;是否安装&lt;/span&gt;mail&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;[root@ProxyServer&amp;nbsp;~]#&amp;nbsp;rpm&amp;nbsp;-qa|grep&amp;nbsp;mail&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;libreport-plugin-mailx-2.0.9-19.el6.x86_64&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;mailx-12.4-7.el6.x86_64&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;procmail-3.22-25.1.el6.x86_64&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;mailcap-2.1.31-2.el6.noarch&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 28px;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;sendmail-8.14.4-8.el6.x86_64&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729684985629879.png&quot; title=&quot;图片1.png&quot; alt=&quot;图片1.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;若&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;未安装，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;安装&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;mail&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:14px;text-indent:14px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;yum –y install mailx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685031297965.png&quot; title=&quot;图片2.png&quot; alt=&quot;图片2.png&quot;/&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:14px;text-indent:14px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;yum install sendmail&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685047271375.png&quot; title=&quot;图片3.png&quot; alt=&quot;图片3.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;2.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;编辑&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;配置文件&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;vi&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;/etc/mail.rc&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;在&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;文件末尾添加&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set from=luojiahan1234@qq.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set smtp=smtp.qq.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set smtp-auth-user=luojiahan1234@qq.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set smtp-auth-password=wahnqizfqnoybjfa&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set smtp-auth=login&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;from&lt;span style=&quot;font-family:宋体&quot;&gt;：对方收到邮件时显示的发件人&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;smtp&lt;span style=&quot;font-family:宋体&quot;&gt;：指定第三方发邮件的&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;smtp&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;服务器地址&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;set smtp-auth-user&lt;span style=&quot;font-family:宋体&quot;&gt;：第三方发邮件的用户名&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;set smtp-auth-password&lt;span style=&quot;font-family:宋体&quot;&gt;：用户名对应的密码&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;有些邮箱填的是授权码&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;smtp-auth&lt;span style=&quot;font-family:宋体&quot;&gt;：&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;SMTP&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;的认证方式，默认是&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;login&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;，也可以改成&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;CRAM-MD5&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;或&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;PLAIN&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;方式&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;再&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;添加&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set smtp-use-starttls&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set ssl-verify=ignore&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;set nss-config-dir=/etc/pki/nssdb/&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;ssl&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;-verify&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;：&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;ssl&lt;span style=&quot;font-family:宋体&quot;&gt;类型&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;nss-config-dir&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;：存放&lt;/span&gt; QQ &lt;span style=&quot;font-family:宋体&quot;&gt;邮箱 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;SSL &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;证书的位置&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;3.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;因为阿里云&lt;/span&gt; ECS &lt;span style=&quot;font-family:宋体&quot;&gt;封禁了&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;端口，所以我们只能使用 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;TLS &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;方式（&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;TSL &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;也就是使用 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;SSL &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;加密的方式&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;使用&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;465&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;或者其他端口来发送邮件）绕过&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;端口需求来发送邮件，所以必须先获得邮箱的 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;SSL &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;证书并存放到本地，最后一行的 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;nss-config-dir &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;就是制定的存放 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;QQ &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;邮箱 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;SSL &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;证书的位置。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;因为需要&lt;/span&gt; QQ &lt;span style=&quot;font-family:宋体&quot;&gt;邮箱的 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;SSL &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;证书，所以我们还需要手动的获取&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;QQ &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;邮箱的证书保存到本地指定的目录里以备调用和验证，具体命令如下&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;mkdir -p /root/.certs/&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne &amp;#39;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p&amp;#39; &amp;gt; ~/.certs/qq.crt&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;certutil -A -n &amp;quot;GeoTrust SSL CA&amp;quot; -t &amp;quot;C,,&amp;quot; -d ~/.certs -i ~/.certs/qq.crt&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;certutil -A -n &amp;quot;GeoTrust Global CA&amp;quot; -t &amp;quot;C,,&amp;quot; -d ~/.certs -i ~/.certs/qq.crt&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;certutil -L -d /root/.certs&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;smtp.qq.com:465&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;：&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;根据自己情况更改&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685105187041.png&quot; title=&quot;图片4.png&quot; alt=&quot;图片4.png&quot;/&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685113160772.png&quot; title=&quot;图片5.png&quot; alt=&quot;图片5.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685122858415.png&quot; title=&quot;图片6.png&quot; alt=&quot;图片6.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;4.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;为了防止出现前文所说的发送邮件警告提示，还需要进入邮箱&lt;/span&gt; SSL &lt;span style=&quot;font-family:宋体&quot;&gt;证书存放目录 &lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;/root/.certs &lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;里执行如下命令：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;/root/.certs&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;certutil -A -n &amp;quot;GeoTrust SSL CA - G3&amp;quot; -t &amp;quot;Pu,Pu,Pu&amp;quot; -d ./ -i qq.crt&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;返回如下提示即可：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;**Notice: Trust flag u is set automatically if the private key is present.**&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685150568531.png&quot; title=&quot;图片7.png&quot; alt=&quot;图片7.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;5.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;echo &amp;quot;&lt;span style=&quot;font-family:宋体&quot;&gt;测试邮件&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;&amp;quot; | mail -s &amp;quot;&lt;/span&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;测试&lt;/span&gt;&lt;span style=&quot;font-family:Calibri&quot;&gt;&amp;quot; XXX@qq.com&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;注意&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;事项：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;1.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;在第&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;二&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;步&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;之前应该&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;在&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;邮箱设置内&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;打开&lt;/span&gt;POP3/SMTP/IMAP&lt;span style=&quot;font-family:宋体&quot;&gt;功能，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;如果有授权码获取授权码&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;2.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;–bash: certutil: command not found &lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;报错&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:24px&quot;&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;yum&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;–y install nss-tools&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:24px&quot;&gt;&lt;span style=&quot;font-family:Calibri;font-size:14px&quot;&gt;3.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;邮箱&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;并非&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;实时&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;通信，发送后未收到邮件请等待几分钟。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;QQ&lt;/span&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;span style=&quot;font-family:宋体&quot;&gt;邮箱开&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:宋体;font-size:14px&quot;&gt;POP3/SMTP/IMAP&lt;span style=&quot;font-family:宋体&quot;&gt;功能&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;img class=&quot;ue-image&quot; src=&quot;https://www.lpp521.com/zb_users/upload/2024/10/202410231729685184392327.png&quot; title=&quot;图片8.png&quot; alt=&quot;图片8.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;;font-family:Calibri;font-size:14px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2024 20:00:46 +0800</pubDate></item><item><title>设置SSH免密码登录</title><link>https://www.lpp521.com/?id=5</link><description>&lt;p style=&quot;white-space: normal;&quot;&gt;在linux中进行各个系统之间进行ssh通信时，必须知道对方的账户密码，才能进行相应的操作。&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;思路：通过RSA加密算生成了密钥，包括私钥和公钥，我们把公钥追加到用来认证授权的key中去。&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;假设有A、B两台服务器&lt;/p&gt;&lt;h2 style=&quot;white-space: normal;&quot;&gt;生成密钥&lt;/h2&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;在A服务器生成密钥&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;strong&gt;1.生成rsa密钥，将所有要免密的主机都生成密钥（已生成的可以跳过）&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;ssh-keygen&amp;nbsp;-t&amp;nbsp;rsa&lt;/pre&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620556956204230.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;三个设置，可以直接回车默认&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;enter file in which to save the key (/root/.ssh/id_rsa): 输入保存密钥的文件，默认是登陆用户的home目录&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;enter passphrase (empty for no passphrase): 输入密码短语（没有密码短语为空）&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;enter same passphrase again: 再次输入相同的密码短语：&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;strong&gt;2.进入.ssh目录&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;cd&amp;nbsp;~/.ssh/&lt;/pre&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2 style=&quot;white-space: normal;&quot;&gt;发送授权文件&lt;/h2&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;1.把公钥文件放入授权文件中&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;cat&amp;nbsp;id_rsa.pub&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;authorized_keys&lt;/pre&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;2.发送授权文件到B服务器&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;scp&amp;nbsp;~/.ssh/authorized_keys&amp;nbsp;username@ip:~/.ssh/&lt;/pre&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;username：B服务器内的用户名&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;ip：B服务器的ip地址&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;未进行任何的ssh操作之前，home目录下没有.ssh目录，执行这一步时会报错&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620557290884511.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;可以去B服务器手动创建.ssh目录，权限为700&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;执行完上诉操作即可实现A服务器免密登陆B服务器&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;若想让B服务器免密登陆A服务器，则需要在B服务器生成密钥，将公钥发送到A服务器。&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&lt;strong&gt;注意：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;1.如果设置好后无法免密登陆，检查如下两个权限&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;.ssh权限为700&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;authorized_keys权限为644&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;white-space: normal;&quot;&gt;2.如果A、B服务器有多个账户，使用其它账户并不能免密登陆&lt;/p&gt;</description><pubDate>Sun, 09 May 2021 19:06:37 +0800</pubDate></item><item><title>rdiff-backup（增量备份工具）手册_中英文对照_机翻</title><link>https://www.lpp521.com/?id=4</link><description>&lt;p&gt;&lt;span style=&quot;font-size:16px&quot;&gt;Version 1.3.3 &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;MARCH 2009&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;SYNOPSIS &lt;span style=&quot;font-family:宋体&quot;&gt;简介&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup [options] [[[user@]host1.foo]::source_directory] [[[user@]host2.foo]::destination_directory]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup {{ -l | --list-increments } | --remove-older-than time_interval | --list-at-time time | --list-changed-since time | --list-increment-sizes | --verify | --verify-at-time time} [[[user@]host2.foo]::destination_directory]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup --calculate-average statfile1 statfile2 ...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup --test-server [user1]@host1.net1::path [[user2]@host2.net2::path] ...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;DESCRIPTION &lt;span style=&quot;font-family:宋体&quot;&gt;说明&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup is a script, written in python(1) that backs up one directory to another. The target directory ends up a copy (mirror) of the source directory, but extra reverse diffs are stored in a special subdirectory of that target directory, so you can still recover files lost some time ago. The idea is to combine the best features of a mirror and an incremental backup. rdiff-backup also preserves symlinks, special files, hardlinks, permissions, uid/gid ownership, and modification times.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Rdiff-backup&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family: 宋体&quot;&gt;是一个用python(1)编写的脚本，它将一个目录备份到另一个目录。目标目录最终是源目录的一个副本（镜像），但是额外的反向差异存储在目标目录的一个特殊子目录中，因此您仍然可以恢复一段时间前丢失的文件。其思想是将镜像和增量备份的最佳功能结合起来。Rdiff-backup还保留符号链接、特殊文件、硬链接、权限、uid/gid所有权和修改时间。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup can also operate in a bandwidth efficient manner over a pipe, like rsync(1). Thus you can use ssh and rdiff-backup to securely back a hard drive up to a remote location, and only the differences will be transmitted. Using the default settings, rdiff-backup requires that the remote system accept ssh connections, and that rdiff-backup is installed in the user&amp;#39;s PATH on the remote system. For information on other options, see the section on REMOTE OPERATION.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Rdiff-backup&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family: 宋体&quot;&gt;也可以通过管道以带宽高效的方式运行，如rsync(1)。因此，您可以使用ssh和rdiff备份将硬盘安全地备份到远程位置，并且只传输差异。使用默认设置，rdiff备份要求远程系统接受ssh连接，并且rdiff-backup安装在远程系统的用户路径中。有关其他选项的信息，请参阅有关远程操作的部分。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Note that you should not write to the mirror directory except with rdiff-backup. Many of the increments are stored as reverse diffs, so if you delete or modify a file, you may lose the ability to restore previous versions of that file.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:32px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;请注意，除了使用rdiff-backup外，不应写入镜像目录。许多增量存储为反向差异，因此如果删除或修改文件，可能会失去还原该文件以前版本的能力。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Finally, this man page is intended more as a precise description of the behavior and syntax of rdiff-backup. New users may want to check out the examples.html file included in the rdiff-backup distribution.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;最后，此手册页旨在更准确地描述rdiff-backup的行为和语法。新用户可能希望给出rdiff-backup分发中包含的examples.html文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;OPTIONS &lt;span style=&quot;font-family:宋体&quot;&gt;选项&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;-b, --backup-mode&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Force backup mode even if first argument appears to be an increment or mirror file.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;强制备份模式，即使第一个参数看起来是增量或镜像文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--calculate-average&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enter calculate average mode. The arguments should be a number of statistics files. rdiff-backup will print the average of the listed statistics files and exit.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;进入计算平均值模式。参数应该是一些统计文件。rdiff-backup将打印列出的统计文件的平均值并退出。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--carbonfile&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enable backup of MacOS X carbonfile information.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;启用MacOS X carbonfile信息的备份。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--check-destination-dir&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If an rdiff-backup session fails, running rdiff-backup with this option on the destination dir will undo the failed directory. This happens automatically if you attempt to back up to a directory and the last backup failed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果rdiff-backup会话失败，在目标目录上使用此选项运行rdiff-backup将撤消失败的目录。如果您尝试备份到目录，但最后一次备份失败，则会自动发生这种情况。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--compare&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is equivalent to &amp;#39;--compare-at-time now&amp;#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;这相当于“—compare-at-time now”&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--compare-at-time time&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare a directory with the backup set at the given time. This can be useful to see how archived data differs from current data, or to check that a backup is current. This only compares metadata, in the same way rdiff-backup decides whether a file has changed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;将目录与给定时间的备份集进行比较。这有助于查看存档数据与当前数据的区别，或者检查备份是否为当前备份。这只比较元数据，就像rdiff-backup决定文件是否已更改一样。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--compare-full&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is equivalent to &amp;#39;--compare-full-at-time now&amp;#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--compare-full-at-time time&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare a directory with the backup set at the given time. To compare regular files, the repository data will be copied in its entirety to the source side and compared byte by byte. This is the slowest but most complete compare option.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;将目录与给定时间的备份集进行比较。为了比较常规文件，存储库数据将全部复制到源端，并逐字节进行比较。这是最慢但最完整的比较选项。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--compare-hash&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is equivalent to &amp;#39;--compare-hash-at-time now&amp;#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--compare-hash-at-time time&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare a directory with the backup set at the given time. Regular files will be compared by computing their SHA1 digest on the source side and comparing it to the digest recorded in the metadata.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;将目录与给定时间的备份集进行比较。通过计算源端的SHA1摘要并将其与元数据中记录的摘要进行比较，可以比较常规文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--create-full-path&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Normally only the final directory of the destination path will be created if it does not exist. With this option, all missing directories on the destination path will be created. Use this option with care: if there is a typo in the remote path, the remote filesystem could fill up very quickly (by creating a duplicate backup tree). For this reason this option is primarily aimed at scripts which automate backups.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;通常，如果目标路径不存在，则只创建该路径的最终目录。使用此选项，将在目标路径上创建所有缺少的目录。小心使用此选项：如果远程路径中有输入错误，远程文件系统可能会很快填满（通过创建一个重复的备份树）。因此，此选项主要针对自动备份的脚本。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--current-time seconds&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;This option is useful mainly for testing. If set, rdiff-backup will use it for the current time instead of consulting the clock. The argument is the number of seconds since the epoch.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;此选项主要用于测试。如果设置，rdiff backup将在当前时间使用它，而不是查询时钟。参数是自纪元以来的秒数。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude shell_pattern&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclude the file or files matched by shell_pattern. If a directory is matched, then files under that directory will also be matched. See the FILE SELECTION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除一个或多个与外壳模式匹配的文件。如果目录匹配，则该目录下的文件也将匹配。有关详细信息，请参见文件选择部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-device-files&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclude all device files. This can be useful for security/permissions reasons or if rdiff-backup is not handling device files correctly.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除所有设备文件。这对于安全/权限原因或rdiff-backup未正确处理设备文件时非常有用。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-fifos&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclude all fifo files.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除所有fifo文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-filelist filename&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Excludes the files listed in filename. If filename is handwritten you probably want --exclude-globbing-filelist instead. See the FILE SELECTION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除文件名中列出的文件。如果文件名是手写的，您可能需要这个命令--exclude-globbing-filelist。有关详细信息，请参见文件选择部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-filelist-stdin&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Like --exclude-filelist, but the list of files will be read from standard input. See the FILE SELECTION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—exclude-filelist相似，但将从标准输入读取文件列表。有关详细信息，请参见文件选择部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-globbing-filelist filename&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Like --exclude-filelist but each line of the filelist will be &lt;strong&gt;interpreted according to the same rules as --include and --exclude.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—exclude-filelist相似，但是filelist的每一行都将按照--include和--exclude相同的规则进行解释。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-globbing-filelist-stdin&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Like --exclude-globbing-filelist, but the list of files will be read from standard input.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—exclude-globbing-filelist相似，但将从标准输入读取文件列表。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-other-filesystems&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclude files on file systems (identified by device number) other than the file system the root of the source directory is on.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除文件系统（由设备号标识）上的文件，而不是源目录根目录所在的文件系统。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-regexp regexp&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Exclude files matching the given regexp. Unlike the --exclude option, this option does not match files in a directory it matches. See the FILE SELECTION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除与给定regexp匹配的文件。与--exclude选项不同，此选项与它匹配的目录中的文件不匹配。有关详细信息，请参见文件选择部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-special-files&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclude all device files, fifo files, socket files, and symbolic links.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除所有设备文件、fifo文件、套接字文件和符号链接。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-sockets&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Exclude all socket files.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除所有套接字文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-symbolic-links&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Exclude all symbolic links. This option is automatically enabled if the backup source is running on native Windows to avoid backing-up NTFS reparse points.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除所有符号链接。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--exclude-if-present filename&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Exclude directories if filename is present. This option needs to come before any other include or exclude options.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果存在文件名，则排除目录。此选项必须先于任何其他包含或排除选项。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--force&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Authorize a more drastic modification of a directory than usual (for instance, when overwriting of a destination path,&amp;nbsp; or when removing multiple sessions with --remove-older-than). rdiff-backup will generally tell you if it needs this. WARNING: You can cause data loss if you mis-use this option. Furthermore, do NOT use this option when doing a restore, as it will DELETE FILES, unless you absolutely know what you are doing.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;授权对目录进行比通常更剧烈的修改（例如，当覆盖目标路径时，或当使用—remove-older-than删除多个会话时）。rdiff备份通常会告诉你它是否需要这个。警告：如果不正确使用此选项，可能会导致数据丢失。此外，在执行还原时不要使用此选项，因为它将删除文件，除非您完全知道要执行的操作。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--group-mapping-file filename&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Map group names and ids according the the group mapping file filename. See the USERS AND GROUPS section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;根据组映射文件名映射组名称和标识。有关详细信息，请参阅“用户和组”部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include shell_pattern&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Similar to --exclude but include matched files instead. Unlike --exclude, this option will also match parent directories of matched files (although not necessarily their contents). See the FILE SELECTION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;类似于—exclude，包含匹配的文件。与--exclude不同，此选项还将匹配文件的父目录（尽管不一定是其内容）。有关详细信息，请参见文件选择部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include-filelist filename&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Like --exclude-filelist, but include the listed files instead. If filename is handwritten you probably want --include-globbing-filelist instead. See the FILE SELECTION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—exclude-filelist相似，但要包含列出的文件。如果文件名是手写的，您可能需要这个命令-- include-globbing-filelist。有关详细信息，请参见文件选择部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include-filelist-stdin&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Like --include-filelist, but read the list of included files from standard input.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—include-filelist相似，但从标准输入中读取包含文件的列表。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include-globbing-filelist filename&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Like --include-filelist but each line of the filelist will be interpreted according to the same rules as --include and --exclude.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—include-filelist相似，但是文件列表的每一行都将按照--include和--exclude相同的规则进行解释。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include-globbing-filelist-stdin&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Like --include-globbing-filelist, but the list of files will be read from standard input.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—include-globbing-filelist相似，但文件列表将从标准输入读取。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include-regexp regexp&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Include files matching the regular expression regexp. Only files explicitly matched by regexp will be included by this option. See the FILE SELECTION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;包含与正则表达式regexp匹配的文件。此选项只包含与regexp显式匹配的文件。有关详细信息，请参见文件选择部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include-special-files&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Include all device files, fifo files, socket files, and symbolic links.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;包括所有设备文件、fifo文件、套接字文件和符号链接。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--include-symbolic-links&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Include all symbolic links.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;包括所有符号链接。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--list-at-time time&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;List the files in the archive that were present at the given time. If a directory in the archive is specified, list only the files under that directory.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;列出存档中在给定时间存在的文件。如果指定了存档中的目录，则仅列出该目录下的文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--list-changed-since time&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;List the files that have changed in the destination directory since the given time. See TIME FORMATS for the format of time. If a directory in the archive is specified, list only the files under that directory. This option does not read the source directory; it is used to compare the contents of two different rdiff-backup sessions.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;列出自给定时间以来目标目录中已更改的文件。有关时间格式，请参见时间格式。如果指定了存档中的目录，则仅列出该目录下的文件。此选项不读取源目录；它用于比较两个不同rdiff-backup会话的内容。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;-l, --list-increments&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;List the number and date of partial incremental backups contained in the specified destination directory. No backup or restore will take place if this option is given.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;列出指定目标目录中包含的部分增量备份的数目和日期。如果提供此选项，则不会进行备份或还原。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--list-increment-sizes&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;List the total size of all the increment and mirror files by time. This may be helpful in deciding how many increments to keep, and when to --remove-older-than. Specifying a subdirectory is allowable; then only the sizes of the mirror and increments pertaining to that subdirectory will be listed.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;按时间列出所有增量和镜像文件的总大小。这可能有助于确定要保留多少增量，以及何时删除早于的增量。允许指定子目录；然后只列出镜像的大小和与该子目录相关的增量。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--max-file-size size&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Exclude files that are larger than the given size in bytes&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除大于给定字节大小的文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--min-file-size size&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Exclude files that are smaller than the given size in bytes&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;排除小于给定字节大小的文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--never-drop-acls&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Exit with error instead of dropping acls or acl entries. Normally this may happen (with a warning) because the destination does not support them or because the relevant user/group names do not exist on the destination side.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;退出时出错，而不是删除acl或acl条目。通常情况下，这可能会发生（带有警告），因为目标不支持它们，或者因为目标端不存在相关的用户/组名称。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-acls&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;No Access Control Lists - disable backup of ACLs&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;无访问控制列表-禁用ACL备份&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-carbonfile&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Disable backup of MacOS X carbonfile information&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;禁用MacOS X carbonfile信息的备份&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-compare-inode&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;This option prevents rdiff-backup from flagging a hardlinked file as changed when its device number and/or inode changes. This option is useful in situations where the source filesystem lacks persistent device and/or inode numbering. For example, network filesystems may have mount-to-mount differences in their device number (but possibly stable inode numbers); USB/1394 devices may come up at different device numbers each remount (but would generally have same inode number); and there are filesystems which don&amp;#39;t even have the same inode numbers from use to use. Without the option rdiff-backup may generate unnecessary numbers of tiny diff files.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;此选项可防止rdiff-backup在硬链接文件的设备号和/或索引节点更改时将其标记为已更改。在源文件系统缺少持久设备和/或索引节点编号的情况下，此选项非常有用。例如，网络文件系统可能在其设备编号（但可能是稳定的inode编号）上存在装载到装载的差异；每次重新装载时，USB/1394设备可能会出现不同的设备编号（但通常会有相同的inode编号）；并且有些文件系统甚至在使用时都没有相同的inode编号。如果没有rdiff备份选项，可能会生成不必要数量的微型diff文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-compression&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Disable the default gzip compression of most of the .snapshot and .diff increment files stored in the rdiff-backup-data directory. A backup volume can contain compressed and uncompressed increments, so using this option inconsistently is fine.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;禁用默认gzip压缩,存储在rdiff-backup-data目录中的大多数.snapshot和.diff增量文件的默认gzip压缩。备份卷可以包含压缩增量和未压缩增量，因此可以不一致地使用此选项。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-compression-regexp&amp;nbsp; regexp&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Do not compress increments based on files whose filenames match regexp. The default includes many common audiovisual&amp;nbsp; and archive files, and may be found in Globals.py.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;不要基于文件名与regexp匹配的文件压缩增量。默认值包括许多常见的视听和存档文件，可以在全局.py。&lt;/span&gt; &lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;globals() &lt;/span&gt;&lt;span style=&quot;font-size: 16px;font-family:宋体&quot;&gt;函数会以字典类型返回当前位置的全部全局变量。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-eas&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;No Extended Attributes support - disable backup of EAs.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;不支持扩展属性-禁用EAs备份。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-file-statistics&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;This will disable writing to the file_statistics file in the rdiff-backup-data directory. rdiff-backup will run slightly quicker and take up a bit less space.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;这将禁用对rdiff-backup-data目录中的文件统计信息文件的写入。Rdiff-backup将运行得稍微快一点，占用的空间也会少一点。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--no-hard-links&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Don&amp;#39;t replicate hard links on destination side. If many hardlinked files are present, this option can drastically decrease memory usage. This option is enabled by default if the backup source or restore destination is running on native Windows.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;不要在目标端复制硬链接。如果存在许多硬链接文件，则此选项可以显著减少内存使用。如果备份源或还原目标在本机Windows上运行，则默认情况下启用此选项。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--null-separator&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Use nulls (\0) instead of newlines (\n) as line separators, which may help when dealing with filenames containing newlines. This affects the expected format of the files specified by the --{include|exclude}-filelist[-stdin] switches as well as the format of the directory statistics file.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;使用nulls（\0）而不是newlines（\n）作为行分隔符，这可能有助于处理包含新行的文件名。这会影响--{include | exclude}-filelist[-stdin]开关指定的文件的预期格式以及目录统计文件的格式。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--override-chars-to-quote&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;If the filesystem to which we are backing up is not case-sensitive,&amp;nbsp; automatic&amp;nbsp; &amp;#39;quoting&amp;#39; of characters occurs. For example, a file &amp;#39;Developer.doc&amp;#39; will be converted into &amp;#39;;068eveloper.doc&amp;#39;. To override this behavior, you need to specify this option.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果要备份的文件系统不是区分大小写的，则会自动“引用”字符。例如，一个文件‘Devieloper.doc’将转换为‘;068eveloper.doc’文件. 要禁止此行为，需要指定此选项。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--parsable-output&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;If set, rdiff-backup&amp;#39;s output will be tailored for easy parsing by computers, instead of convenience for humans. Currently this only applies when listing increments using the -l or --list-increments switches, where the time will be given in seconds since the epoch.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;设置此项，rdiff-backup的输出将被定制为便于计算机解析，而不是方便人类。目前，这仅适用于使用-l或--lis-increments列出增量时，其中的时间将以自纪元以来的秒为单位。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--preserve-numerical-ids&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;If set, rdiff-backup will preserve uids/gids instead of trying to preserve unames and gnames. See the USERS AND GROUPS section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果设置，rdiff-backup将保留uid/gid，而不是试图保留uname和gnames。有关详细信息，请参阅“用户和组”部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--print-statistics&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;If set, summary statistics will be printed after a successful backup. If not set, this information will still be available from the session statistics file. See the STATISTICS section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果设置，则成功备份后将打印摘要统计信息。如果未设置，则会话统计文件中仍将提供此信息。有关详细信息，请参阅“统计”部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;-r, --restore-as-of restore_time&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Restore the specified directory as it was as of restore_time. See the TIME FORMATS section for more information on the format of restore_time, and see the RESTORING section for more information on restoring.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;将指定目录还原为某个时间时的状态。有关还原时间格式的详细信息，请参阅时间格式部分；有关还原的详细信息，请参阅还原部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--remote-cmd cmd&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Deprecated. Please use --remote-schema instead&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;已弃用。请改用—remote-schema&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--remote-schema schema&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Specify an alternate method of connecting to a remote computer. This is necessary to get rdiff-backup not to use ssh for remote backups, or if, for instance, rdiff-backup is not in the PATH on the remote side. See the REMOTE OPERATION section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;指定另一种连接到远程计算机的方法。这对于rdiff-backup不使用ssh进行远程备份是必要的，或者如果rdiff-backup不在远程端的路径中。有关详细信息，请参阅远程操作部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--remote-tempdir path&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Adds the --tempdir option with argument path when invoking remote instances of rdiff-backup.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;在调用rdiff-backup的远程实例时，添加带参数path的--tempdir选项。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--remove-older-than time_spec&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Remove the incremental backup information in the destination directory that has been around longer than the given time. time_spec can be either an absolute time, like &amp;quot;2002-01-04&amp;quot;, or a time interval. The time interval is an integer followed by the character s, m, h, D, W, M, or Y, indicating seconds, minutes, hours, days, weeks, months, or years respectively, or a number of these concatenated. For example, 32m means 32 minutes, and 3W2D10h7s means 3 weeks, 2 days, 10 hours, and 7 seconds. In this context, a month means 30 days, a year is 365 days, and a day is always 86400 seconds.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;删除目标目录中超过给定时间的增量备份信息。时间规范可以是绝对时间，如“2002-01-04”，也可以是时间间隔。时间间隔是一个整数，后跟字符s、m、h、D、W、m或Y，分别表示秒、分钟、小时、天、周、月或年，或这些连接的数字。例如，32m表示32分钟，3W2D10h7s表示3周、2天、10小时和7秒。在这种情况下，一个月意味着30天，一年意味着365天，一天总是86400秒。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup cannot remove-older-than and back up or restore in a single session. In order to both backup a directory and remove old files in it, you must run rdiff-backup twice.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Rdiff-backup&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family: 宋体&quot;&gt;无法在单个备份或还原会话中删除。为了备份目录并删除其中的旧文件，必须运行rdiff backup两次。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;By default, rdiff-backup will only delete information from one session at a time. To remove two or more sessions at the same time, supply the --force option (rdiff-backup will tell you if --force is required).&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;默认情况下，rdiff-backup一次只能从一个会话中删除信息。要同时删除两个或多个会话，请提供--force选项（rdiff backup将告诉您是否需要--force）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Note that snapshots of deleted files are covered by this operation. Thus if you deleted a file two weeks ago, backed up immediately afterwards, and then ran rdiff-backup with --remove-older-than 10D today, no trace of that file would remain. Finally, file selection options such as --include and --exclude don&amp;#39;t affect --remove-older-than.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;请注意，此操作将包含已删除文件的快照。因此，如果两周前删除了一个文件，然后立即备份，然后使用—remove-older-than 10D today运行rdiff backup，则不会保留该文件的任何痕迹。最后，文件选择选项（如--include和--exclude）不影响—remove-older-than。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--restrict path&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Require that all file access be inside the given path. This switch, and the following two, are intended to be used with the --server switch to provide a bit more protection when doing automated remote backups. They are not intended as your only line of defense so please don&amp;#39;t do something silly like allow public access to an rdiff-backup server run with --restrict-read-only.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;要求所有文件访问都在给定路径内。此选项和以下两个选项是与—server选项一起使用，以便在执行自动远程备份时提供更多保护。它们并不是你唯一的防线，所以请不要做一些愚蠢的事情，比如允许公共访问rdiff-backup服务器，运行时使用—restrict-read-only。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--restrict-read-only path&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Like --restrict, but also reject all write requests.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—restrict相似，但拒绝所有写请求。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--restrict-update-only path&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Like --restrict, but only allow writes as part of an incremental backup. Requests for other types of writes (for instance, deleting path) will be rejected.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;与—restrict相似，但只允许写入作为增量备份的一部分。对其他类型写入（例如，删除路径）的请求将被拒绝。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--server&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Enter server mode (not to be invoked directly, but instead used by another rdiff-backup process on a remote computer).&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;进入服务器模式（不直接调用，而是由远程计算机上的另一个rdiff-backup进程使用）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--ssh-no-compression&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;When running ssh, do not use the -C option to enable compression. --ssh-no-compression is ignored if you specify a new schema using --remote-schema.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;运行ssh时，不要使用-C选项来启用压缩。--如果使用—remote-schema指定新架构，则不忽略ssh-no-compression。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--tempdir path&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Sets the directory that rdiff-backup uses for temporary files to the given path. The environment variables TMPDIR, TEMP, and TMP can also be used to set the temporary files directory. See the documentation of the Python tempfile module for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;将rdiff-backup用于临时文件的目录设置为给定路径。环境变量TMPDIR、TEMP和TMP也可用于设置临时文件目录。有关更多信息，请参阅Python tempfile模块的文档。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--terminal-verbosity [0-9]&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Select which messages will be displayed to the terminal. If missing the level defaults to the verbosity level.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;选择将向终端显示的消息。如果缺少级别，则默认为详细级别。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--test-server&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Test for the presence of a compatible rdiff-backup server as specified in the following host::filename argument(s). The filename section will be ignored.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;测试是否存在以下host::filename参数中指定的兼容rdiff-backup服务器。文件名部分将被忽略。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--use-compatible-timestamps&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Create timestamps in which the hour/minute/second separator is a - (hyphen) instead of a : (colon). It is safe to use this option on one backup, and then not use it on another; rdiff-backup supports the intermingling of different timestamp formats. This option is enabled by default on platforms which require that the colon be escaped.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;创建时间戳，其中小时/分钟/秒分隔符是一个 -（连字符）而不是一个:（冒号）。在一个备份上使用此选项是安全的，但在另一个备份上不使用；rdiff-backup支持不同时间戳格式的混合。此选项在要求冒号转义的平台上默认启用。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--user-mapping-file filename&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Map user names and ids according to the user mapping file filename. See the USERS AND GROUPS section for more information.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;根据用户映射文件名映射用户名和id。有关详细信息，请参阅“用户和组”部分。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;-v[0-9], --verbosity [0-9]&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Specify verbosity level (0 is totally silent, 3 is the default, and 9 is noisiest). This determines how much is written to the log file.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;指定详细级别（0是完全静默的，3是默认的，9是最详细的）。这决定了写入日志文件的量。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--verify&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;This is short for --verify-at-time now&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;这是 --verify-at-time now&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--verify-at-time now&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Check all the data in the repository at the given time by computing the SHA1 hash of all the regular files and comparing them with the hashes stored in the metadata file.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;通过计算所有常规文件的SHA1散列并将它们与元数据文件中存储的散列进行比较，在给定时间检查存储库中的所有数据。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;-V, --version&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Print the current version and exit&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;打印当前版本并退出&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;RESTORING &lt;span style=&quot;font-family:宋体&quot;&gt;恢复&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;There are two ways to tell rdiff-backup to restore a file or directory. Firstly, you can run rdiff-backup on a mirror file and use the -r or --restore-as-of options. Secondly, you can run it on an increment file.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Rdiff-backup&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family: 宋体&quot;&gt;还原文件或目录有两种方法。首先，可以在镜像文件上运行rdiff-backup，并使用-r或—restore-as选项。其次，可以在增量文件上运行它。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For example, suppose in the past you have run:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;例如，假设您过去运行过：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rdiff-backup /usr /usr.backup&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;to back up the /usr directory into the /usr.backup directory, and now want a copy of the /usr/local directory the way it was 3 days ago placed at /usr/local.old.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;将/usr目录备份到/usr.backup目录，现在需要一个/usr/local目录3天前的副本放到/usr/local.old目录。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align:left&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体;color:black&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; One way to do this is to run:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align:left&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体;color:black&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体;color:black&quot;&gt;一种方法是运行：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rdiff-backup -r 3D /usr.backup/local /usr/local.old&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where above the &amp;quot;3D&amp;quot; means 3 days (for other ways to specify the time, see&amp;nbsp; the&amp;nbsp; TIME&amp;nbsp; FORMATS&amp;nbsp; section). The /usr.backup/local directory was selected, because that is the directory containing the current version of /usr/local.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;上面的“3D”表示3天（有关指定时间的其他方式，请参见“时间格式”部分）。那个/usr.backup/local已选择目录，因为该目录包含当前版本的/usr/local。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Note that the option to --restore-as-of always specifies an exact time. (So &amp;quot;3D&amp;quot; refers to the instant 72 hours before the present.) If there was no backup made at that time, rdiff-backup restores the state recorded for the previous backup. For instance, in the above case, if &amp;quot;3D&amp;quot; is used, and there are only backups from 2 days and 4 days ago, /usr/local as it was 4 days ago will be restored.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;注意—restore-as-of的选项总是指定一个确切的时间。（因此“3D”指的是当前备份前72小时的瞬间。）如果当时没有备份，rdiff-backup将恢复为指定时间点上一次备份记录的状态。例如，在上述情况下，如果使用“3D”，并且只有2天和4天以前的备份，那么/usr/local将恢复到4天以前的状态。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The second way to restore files involves finding the corresponding increment file. It would be in the /backup/rdiff-backup-data/increments/usr directory, and its name would be something like &amp;quot;local.2002-11-09T12:43:53-04:00.dir&amp;quot; where the time indicates it is from 3 days ago. Note that the increment files all end in &amp;quot;.diff&amp;quot;, &amp;quot;.snapshot&amp;quot;, &amp;quot;.dir&amp;quot;, or &amp;quot;.missing&amp;quot;, where &amp;quot;.missing&amp;quot; just means that the file didn&amp;#39;t exist at that time (finally, some of these may be gzip-compressed, and have an extra &amp;quot;.gz&amp;quot; to indicate this). Then running:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;恢复文件的第二种方法是查找相应的增量文件。它将位于/backup/rdiff-backup-data/increments/usr目录中，其名称类似于“local.2002-11-09T12:43:53-04:00.dir”，其中时间表示它来自3天前。请注意，增量文件都以“.diff”、“.snapshot”、“.dir”或“.missing”结尾，其中“.missing”仅表示该文件当时不存在（最后，其中一些文件可能是gzip压缩的，并有一个额外的“.gz”来表示这一点）。然后运行：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rdiff-backup /backup/rdiff-backup-data/increments/usr/local.&amp;lt;time&amp;gt;.dir /usr/local.old&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; would also restore the file as desired.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;也会根据需要还原文件。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you are not sure exactly which version of a file you need, it is probably easiest to either restore from the increments files as described immediately above, or to see which increments are available with -l/--list-increments, and then specify exact times into -r/--restore-as-of.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果您不确定到底需要哪个版本的文件，则可能最容易的方法是从上述增量文件中还原，或者查看-l/--list-incrememts增量中可用的增量，然后指定还原到-r/--restore的确切时间。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;TIME FORMATS&lt;span style=&quot;font-family:宋体&quot;&gt;时间格式&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup uses time strings in two places. Firstly, all of the increment files rdiff-backup creates will have the time in their file-names in the w3 datetime format as described in a w3 note at http://www.w3.org/TR/NOTE-datetime.Basically they look like &amp;quot;2001-07-15T04:09:38-07:00&amp;quot;, which means what it looks like. The &amp;quot;-07:00&amp;quot; section means the time zone is 7 hours behind UTC.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Secondly, the -r, --restore-as-of, and --remove-older-than options take a time string, which can be given in any of several formats:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family: 宋体&quot;&gt;在两个地方使用到时间字符串。首先，rdiff backup创建的所有增量文件的时间都将以w3 datetime格式显示在其文件名中，参考http://www.w3.org/TR/NOTE-datetime。例如“2001-07-15T04:09:38-07:00”， “-07:00”部分表示时区比UTC晚7小时。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;其次，-r，--restore-as-of和--remove-older-than选项使用一个时间字符串，该字符串可以以多种格式给出：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;1.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;the string &amp;quot;now&amp;quot; (refers to the current time)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;字符串“now”（指当前时间）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;2.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;a sequences of digits, like &amp;quot;123456890&amp;quot; (indicating the time in seconds after the epoch)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;一系列数字，如“123456890”（表示纪元后的秒数）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;时间戳是自 1970 年 1 月 1 日(08:00:00 GMT)(00:00:00 UTC)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;3.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;A string like &amp;quot;2002-01-25T07:00:00+02:00&amp;quot; in datetime format&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;日期时间格式的字符串，如“2002-01-25T07:00:00+02:00”&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;4.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;An interval, which is a number followed by one of the characters s, m, h, D, W, M, or Y (indicating seconds, minutes, hours, days, weeks, months, or years respectively), or a series of such pairs. In this case the string refers to the time that preceded the current time by the length of the interval. For instance, &amp;quot;1h78m&amp;quot; indicates the time that was one hour and 78 minutes ago. The calendar here is unsophisticated: a month is always 30 days, a year is always 365 days, and a day is always 86400 seconds.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;一种间隔，它是一个数字，后跟字符s、m、h、D、W、M或Y中的一个（分别表示秒、分、小时、天、周、月或年），或一系列这样的对。在这种情况下，字符串是指当前时间之前的时间与间隔的长度。例如，“1h78m”表示一小时七八分钟前的时间。这里的日历很简单：一个月总是30天，一年总是365天，一天总是86400秒。&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;5.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;A date format of the form YYYY/MM/DD, YYYY-MM-DD, MM/DD/YYYY, or MM-DD-YYYY, which indicates midnight on the day in question, relative to the current timezone settings. For instance, &amp;quot;2002/3/5&amp;quot;, &amp;quot;03-05-2002&amp;quot;, and &amp;quot;2002-3-05&amp;quot; all mean March 5th, 2002.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;格式为YYYY/MM/DD、YYYY-MM-DD、MM/DD/YYYY或MM-DD-YYYY的日期格式，相对于当前时区设置，它表示指定日期的午夜（凌晨零点，包含这一天）。例如，“2002/3/5”、“03-05-2002”和“2002-3-05”都是指2002年3月5日00:00:00。&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;6.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;A backup session specification which is a non-negative integer followed by &amp;#39;B&amp;#39;. For instance, &amp;#39;0B&amp;#39; specifies the time of the current mirror, and &amp;#39;3B&amp;#39; specifies the time of the 3rd newest increment.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;一个备份会话规范，它是一个非负整数，后跟“B”。例如，“0B”指定当前镜像的时间，“3B”指定第三个最新增量的时间。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;REMOTE OPERATION &lt;span style=&quot;font-family:宋体&quot;&gt;远程操作&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;In order to access remote files, rdiff-backup opens up a pipe to a copyof rdiff-backup running on the remote machine. Thus rdiff-backup must be installed on both ends. To open this pipe, rdiff-backup first splits the filename into host_info::pathname. It then substitutes host_info into the remote schema, and runs the resulting command, reading its input and output.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;为了访问远程文件，rdiff-backup打开了一个管道，指向远程计算机上运行的rdiff-backup副本。因此，必须在两端安装rdiff-backup。要打开此管道，rdiff-backup首先将文件名拆分为主机信息::路径名。然后，它将主机信息替换到远程模式中，并运行生成的命令，读取其输入和输出。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;The default remote schema is &amp;#39;ssh -C %s rdiff-backup --server&amp;#39; where host_info is substituted for &amp;#39;%s&amp;#39;. So if the host_info is user@host.net, then rdiff-backup runs &amp;#39;ssh user@host.net rdiff-backup --server&amp;#39;. Using --remote-schema, rdiff-backup can invoke an arbitrary command in order to open up a remote pipe. For instance,&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;默认的远程架构是“ssh –C %s rdiff-backup --server”，其中&amp;#39;%s&amp;#39;替换为主机信息。如果主机信息是user@host.net，然后rdiff-backup运行&amp;#39;ssh user@host.net rdiff-backup --server。使用—remote-schema，rdiff-backup可以调用任意命令来打开远程管道。例如，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rdiff-backup --remote-schema &amp;#39;cd&amp;nbsp; /usr;&amp;nbsp; %s&amp;#39;&amp;nbsp; foo&amp;nbsp; &amp;#39;rdiff-backup --server&amp;#39;::bar&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;is basically equivalent to (but slower than)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;基本上等同于（但慢于）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup foo /usr/bar&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Concerning quoting, if for some reason you need to put two consecutive colons in the host_info section of a host_info::pathname argument, or in the pathname of a local file, you can quote one of them by prepending a backslash. So in &amp;#39;a\::b::c&amp;#39;, host_info is &amp;#39;a::b&amp;#39; and the pathname is &amp;#39;c&amp;#39;. Similarly, if you want to refer to a local file whose filename contains two consecutive colons, like &amp;#39;strange::file&amp;#39;, you&amp;#39;ll have to quote one of the colons as in &amp;#39;strange\::file&amp;#39;. Because the backslash is a quote character in these circumstances, it too must be quoted to get a literal backslash, so &amp;#39;foo\::\\bar&amp;#39; evaluates to &amp;#39;foo::\bar&amp;#39;. To make things more complicated, because the backslash is also a common shell quoting character, you may need to type in &amp;#39;\\\\&amp;#39; at the shell prompt to get a literal backslash (if it&amp;nbsp; makes&amp;nbsp; you&amp;nbsp; feel better, I had to type in 8 backslashes to get that in this man page...). And finally, to include a literal % in the string specified by --remote-schema, quote it with another %, as in %%.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;关于引用，如果出于某种原因，您需要在host_info：：pathname参数的host_info部分或本地文件的路径名中放置两个连续冒号，则可以通过在反斜杠前加上一个冒号来引用其中一个冒号。所以在“a\::b::c”中，主机信息是“a::b”，路径名是“c”。类似地，如果要引用文件名包含两个连续冒号的本地文件，如“strange::file”，则必须引用其中一个冒号，如“strange\::file”。因为在这种情况下，反斜杠是引号字符，所以它也必须被引号括起来才能得到文字反斜杠，所以&amp;#39;foo\::\\bar&amp;#39;的计算结果为&amp;#39;foo::\bar&amp;#39;。为了使事情变得更复杂，因为反斜杠也是一个常用的shell引用字符，您可能需要在shell提示符处键入“\\\\”，以获得一个文本反斜杠（如果它让您感觉更好，我必须键入8个反斜杠才能在本手册页中获得它…）。最后，要在—remote-schema指定的字符串中包含一个文本%，请用另一个%引用它，如%%。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Although ssh itself may be secure, using rdiff-backup in the default way presents some security risks. For instance if the server is run as root, then an attacker who compromised the client could then use rdiff-backup to overwrite arbitrary server files by &amp;quot;backing up&amp;quot; over them. Such a setup can be made more secure by using the sshd configuration option command=&amp;quot;rdiff-backup --server&amp;quot; possibly along with the --restrict* options to rdiff-backup. For more information, see the web page, the wiki, and the entries for the --restrict* options on this man page.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;尽管ssh本身可能是安全的，但以默认方式使用rdiff-backup会带来一些安全风险。例如，如果服务器以root用户身份运行，那么危害客户端的攻击者可以使用rdiff-backup通过“备份”任意服务器文件来覆盖这些文件。使用sshd配置选项command=“rdiff-backup --server”可以使这样的设置更加安全，这可能与rdiff-backup的—restrict*选项一起使用。有关详细信息，请参见网页、wiki和此手册页上--restrict*选项的条目。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;FILE SELECTION &lt;span style=&quot;font-family:宋体&quot;&gt;文件选择&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rdiff-backup has a number of file selection options. When rdiff-backup is run, it searches through the given source directory and backs up all the files matching the specified options. This selection system may appear complicated, but it is supposed to be flexible and easy-to-use. If you just want to learn the basics, first look at the selection exam-ples in the examples.html file included in the package, or on the web at http://rdiff-backup.nongnu.org/examples.html&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff backup&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family: 宋体&quot;&gt;有许多文件选择选项。运行rdiff backup时，它会搜索给定的源目录并备份与指定选项匹配的所有文件。这个选择系统可能看起来很复杂，但它应该是灵活和易于使用的。如果你只想学习基本知识，首先看看示例.html包中包含的文件，或在网站上http://rdiff-backup.nongnu.org/examples.html&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup&amp;#39;s selection system was originally inspired by rsync(1), but there are many differences. (For&amp;nbsp; instance, trailing backslashes have no special significance.)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;rdiff-backup&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family: 宋体&quot;&gt;的选择系统最初是受rsync（1）启发的，但有很多不同之处。（例如，后面的反斜杠没有特殊意义。）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The file selection system comprises a number of file selection condi-tions, which are set using one of the following command line options: --exclude, --exclude-filelist, --exclude-device-files, --exclude-fifos, --exclude-sockets, --exclude-symbolic-links, --exclude-globbing- filelist, --exclude-globbing-filelist-stdin, --exclude-filelist-stdin, --exclude-regexp, --exclude-special-files, --include, --include-filelist, --include-globbing-filelist, --include-globbing-filelist-stdin, --include-filelist-stdin, and --include-regexp. Each file selection condition either matches or doesn&amp;#39;t match a given file. A given file is excluded by the file selection system exactly when the first matching file selection condition specifies that the file be excluded; otherwise the file is included. When backing up, if a file is excluded, rdiff-backup acts as if that file does not exist in the source directory. When restoring, an excluded file is considered not to exist in either the source or target directories.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;文件选择系统包含许多文件选择条件，使用下边一个设置选项命令：--exclude, --exclude-filelist, --exclude-device-files, --exclude-fifos, --exclude-sockets, --exclude-symbolic-links, --exclude-globbing- filelist, --exclude-globbing-filelist-stdin, --exclude-filelist-stdin, --exclude-regexp, --exclude-special-files, --include, --include-filelist, --include-globbing-filelist, --include-globbing-filelist-stdin, --include-filelist-stdin, and --include-regexp.&lt;/span&gt; &lt;span style=&quot;font-size: 16px;font-family:宋体&quot;&gt;每个文件选择条件要么匹配要么不匹配给定的文件。当第一个匹配的文件选择条件指定排除文件时，文件选择系统将完全排除给定的文件；否则将包括该文件。备份时，如果排除了某个文件，rdiff backup的作用就像源目录中不存在该文件一样。还原时，排除的文件被认为不存在于源目录或目标目录中。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;USERS AND GROUPS&lt;span style=&quot;font-family:宋体&quot;&gt;用户和组&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;There can be complications preserving ownership across systems. For instance the username that owns a file on the source system may not exist on the destination. Here is how rdiff-backup maps ownership on the source to the destination (or vice-versa, in the case of restoring):&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;跨系统保留所有权可能会有一些复杂的问题。例如，在源系统上拥有文件的用户名在目标系统上可能不存在。以下是rdiff-backup如何将源上的所有权映射到目标（在还原的情况下，反之亦然）：&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0;text-indent:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;1.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;If the --preserve-numerical-ids option is given, the remote files will always have the same uid and gid, both for ownership and ACL entries. This may cause unames and gnames to change.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:24px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果指定了--preserve numerical ids选项，则远程文件的所有权和ACL条目将始终具有相同的uid和gid。这可能会导致unames和gnames发生变化。&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0;text-indent:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;2.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Otherwise, attempt to preserve the user and group names for ownership and in ACLs. This may result in files having different uids and gids across systems.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;否则，请尝试保留所有权和ACL中的用户名和组名。这可能导致跨系统的文件具有不同的uid和gid。&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0;text-indent:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;3.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;If a name cannot be preserved (e.g. because the username does not exist), preserve the original id, but only in cases of user and group ownership. For ACLs, omit any entry that has a bad user or group name.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果无法保留名称（例如，因为用户名不存在），请保留原始id，但仅限于用户和组所有权的情况。对于acl，省略任何具有错误用户名或组名的条目。&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0;text-indent:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;4.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;The --user-mapping-file and --group-mapping-file options override this behavior. If either of these options is given, the policy described in 2 and 3 above will be followed, but with the mapped user and group instead of the original. If you specify both --preserve-numerical-ids and one of the mapping options, the behavior is undefined.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;--user-mapping-file&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;和—group-mapping-file选项将覆盖此行为。如果给定了这些选项中的任何一个，则将遵循上面2和3中描述的策略，但使用映射的用户和组而不是原始用户和组。如果同时指定—preserve-numerical-ids和一个映射选项，则行为未定义。&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot; style=&quot;margin-left:0;text-indent:0&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;5.&lt;span style=&quot;font:9px &amp;#39;Times New Roman&amp;#39;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;The user and group mapping files both have the same form:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraph&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;用户和组映射文件的格式相同：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;old_name_or_id1:new_name_or_id1&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;old_name_or_id2:new_name_or_id2&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;lt;etc&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Each line should contain a name or id, followed by a colon &amp;quot;:&amp;quot;, followed by another name or id. If a name or id is not listed, they are treated in the default way described above.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;每行应包含名称或id，后跟冒号“：”，后跟其他名称或id。如果未列出名称或id，则按上述默认方式处理。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;When restoring, the above behavior is also followed, but note that the original source user/group information will be the input, not the already mapped user/group information present in the backup repository. For instance, suppose you have mapped all the files owned by alice in the source so that they are owned by ben in the repository, and now you want to restore, making sure the files owned originally by alice are still owned by alice. In this case there is no need to use any of the mapping options. However, if you wanted to restore the files so that the files originally owned by alice on the source are now owned by ben, you would have to use the mapping options, even though you just want the unames of the repository&amp;#39;s files preserved in the restored files.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;还原时，也会遵循上述行为，但请注意，原始源用户/组信息将是输入，而不是备份存储库中已映射的用户/组信息。例如，假设您已经映射了源中alice拥有的所有文件，以便它们在存储库中归ben所有，现在您要还原，确保alice最初拥有的文件仍然归alice所有。在这种情况下，不需要使用任何映射选项。但是，如果要还原文件，以便alice在源上最初拥有的文件现在归ben所有，则必须使用映射选项，即使您只希望存储库文件的uname保留在还原的文件中。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;STATISTICS &lt;span style=&quot;font-family:宋体&quot;&gt;统计数据&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Every session rdiff-backup saves various statistics into two files, the session statistics file at rdiff-backup-data/session_statistics.&amp;lt;time&amp;gt;.data and the directory statistics file at rdiff-backup-data/directory_statistics.&amp;lt;time&amp;gt;.data. They are both text files and contain similar information: how many files changed, how many were deleted, the total size of increment files created, etc. However, the session statistics file is intended to be very readable and only describes the session as a whole. The directory statistics file is more compact (and slightly less readable) but describes every directory backed up. It also may be compressed to save space.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;每个会话rdiff-backup都将各种统计信息保存到两个文件中，分别是rdiff-backup-data/session-statistics.&amp;lt;time&amp;gt;.data会话统计信息文件和rdiff-backup-data/directory-statistics.&amp;lt;time&amp;gt;.data目录统计信息文件。它们都是文本文件，包含类似的信息：更改了多少文件、删除了多少文件、创建的增量文件的总大小等。但是，会话统计文件的可读性很强，只描述整个会话。目录统计文件更紧凑（可读性稍差），但描述了备份的每个目录。它也可以压缩以节省空间。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Statistics-related options include --print-statistics and --null-sepa-rator.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;统计相关选项包括—print-statistics和—null-sepa-rator。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Also, rdiff-backup will save various messages to the log file, which is rdiff-backup-data/backup.log for backup sessions and rdiff-backup-data/restore.log for restore sessions. Generally what is written to this file will coincide with the messages displayed to stdout or stderr, although this can be changed with the --terminal-verbosity option.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;此外，rdiff-backup会将各种消息保存到日志文件中，即rdiff-backup-data/backup.log用于备份会话和rdiff-backup-data/restore.log用于还原会话。通常，写入该文件的内容将与显示给stdout或stderr的消息一致，尽管可以使用—terminal-verbosity选项来更改。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;The log file is not compressed and can become quite large if rdiff-backup is run with high verbosity.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果rdiff-backup以高详细度运行，则日志文件不会压缩，并且可能会变得很大。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;EXIT STATUS &lt;span style=&quot;font-family:宋体&quot;&gt;退出状态&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;If rdiff-backup finishes successfully, the exit status will be 0. If there is an unrecoverable (critical) error, it will be non-zero (usually 1, but don&amp;#39;t depend on this specific value). When setting up rdiff-backup to run automatically (as from cron(8) or similar) it is probably a good idea to check the exit code.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;如果rdiff-backup成功完成，退出状态将为0。如果有一个不可恢复（严重）的错误，它将是非零的（通常是1，但不依赖于这个特定的值）。将rdiff-backup设置为自动运行（从cron（8）或类似版本）时，最好检查退出代码。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;BUGS&lt;/h1&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;The gzip library in versions 2.2 and earlier of python (but fixed in 2.3a1) has trouble producing files over 2GB in length. This bug will prevent rdiff-backup from producing large compressed increments (snapshots or diffs). A workaround is to disable compression for large uncompressable files.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;版本2.2及更早版本中的gzip库（在2.3a1中已修复）在生成长度超过2GB的文件时遇到问题。此错误将阻止rdiff备份产生大的压缩增量（快照或差异）。解决方法是对大型不可压缩文件禁用压缩。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;AUTHOR &lt;span style=&quot;font-family:宋体&quot;&gt;作者&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Ben Escoto &amp;lt;ben@emerose.org&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Feel free to ask me questions or send me bug reports, but you may wantto see the web page, mentioned below, first.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;请随时向我提问或向我发送错误报告，但您可能希望首先看到下面提到的网页。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;SEE ALSO &lt;span style=&quot;font-family:宋体&quot;&gt;另见&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;python(1),&amp;nbsp; rdiff(1), rsync(1), ssh(1).&amp;nbsp; The main rdiff-backup web page is at http://rdiff-backup.nongnu.org/.&amp;nbsp; It has more information, links to the mailing list and CVS, etc.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;（1）、rdiff（1）、rsync（1）、ssh（1）。主rdiff-backup网页位于http://rdiff backup.nongu.org/。它有更多的信息，链接到邮件列表和简历等。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sun, 09 May 2021 16:57:34 +0800</pubDate></item><item><title>rdiff-backup（增量备份工具）的安装和使用</title><link>https://www.lpp521.com/?id=3</link><description>&lt;p style=&quot;text-indent: 2em;&quot;&gt;rdiff-backup 是一个用于本地/远程增量备份的强大而易用的 Python 脚本，它适用于任何 POSIX 操作系统，如Linux、Mac OS X 或 Cygwin。它集合了镜像和增量备份的显著特性。&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;值得注意的是，它保留了子目录、dev 文件、硬链接，以及关键的文件属性，如权限、uid/gid 所有权、修改时间、扩展属性、acl 以及 resource fork。它可以通过管道以高效带宽的模式工作，这与流行的 rsync 备份工具类似。&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;rdiff-backup 通过使用 SSH 将单个目录备份到另一个目录，这意味着数据传输被加密并且是安全的。目标目录（在远程系统上）最终会得到源目录的完整副本，但是此外的反向差异会存储在目标目录的特殊子目录中，从而可以恢复前一段时间丢失的文件。&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;如果你通过网络运行它，则必须在两个系统中都安装 rdiff-backup，两者最好是相同版本。&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;使用的系统为CentOS 7。&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;需要ssh支持，使用前请先配置ssh的免密登陆。&lt;/p&gt;&lt;h2&gt;安装rdiff-bakcup&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;1.安装最新版本的EPEL仓库&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;yum&amp;nbsp;install&amp;nbsp;epel-release&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;2.安装Python（可以省略，安装rdiff-backup时会自动安装）&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Python版本不低于v2.2&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;rpm&amp;nbsp;-qa&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;python&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;检查是否安装Python&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;3.安装librsync（可以省略，安装rdiff-backup时会自动安装）&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;Librsync版本不低于v0.9.7&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;rpm&amp;nbsp;-qa&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;librsync&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;检查是否安装librsync&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;安装librsync&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;yum&amp;nbsp;install&amp;nbsp;librsync&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;4.安装pylibacl（可选）（可以省略，安装rdiff-backup时会自动安装）&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;yum&amp;nbsp;install&amp;nbsp;pylibacl&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;5.安装pyxattr Python（可选）（可以省略，安装rdiff-backup时会自动安装）&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;6.安装rdiff-backup&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;yum&amp;nbsp;install&amp;nbsp;rdiff-backup&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620546768901127.png&quot; alt=&quot;image.png&quot;/&gt;&lt;span style=&quot;font-size:16px;font-family:宋体&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2&gt;备份&lt;/h2&gt;&lt;p&gt;源服务器和备份服务器都可以发起备份，第三方服务器也可以发起备份&lt;/p&gt;&lt;p&gt;源服务器发起&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;rdiff-backup&amp;nbsp;/some/local-dir&amp;nbsp;username@ip::/whatever/remote-dir&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;备份服务器发起&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;rdiff-backup&amp;nbsp;username@ip::/some/local-dir&amp;nbsp;/whatever/remote-dir&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549282472258.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;username：ssh登陆的用户名&lt;/p&gt;&lt;p&gt;ip：ssh登陆的ip&lt;/p&gt;&lt;p&gt;&amp;nbsp;/some/local-dir：需要备份的目录&lt;/p&gt;&lt;p&gt;/whatever/remote-dir：备份到备份服务器的目录&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;备份相关选项&lt;/p&gt;&lt;p&gt;--print-statistics 打印摘要统计信息&lt;/p&gt;&lt;p&gt;-v[0-9], --verbosity [0-9] 日志详细级别，默认3，9最详细&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&lt;strong&gt;注意&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ssh非默认端口（22）情况&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;rdiff-backup&amp;nbsp;–remote-schema&amp;nbsp;&amp;#39;ssh&amp;nbsp;-p&amp;nbsp;port&amp;nbsp;%s&amp;nbsp;&amp;quot;rdiff-backup&amp;nbsp;–server&amp;quot;&amp;#39;&amp;nbsp;&amp;#39;username@ip&amp;#39;::/some/local-dir&amp;nbsp;/whatever/remote-dir&lt;/pre&gt;&lt;p&gt;port：ssh端口&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2&gt;查看备份&lt;/h2&gt;&lt;p&gt;rdiff-backup -l /whatever/remote-dir&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620548292230645.png&quot; alt=&quot;image.png&quot; style=&quot;white-space: normal;&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2&gt;恢复&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 恢复时可以恢复整个镜像，也可以恢复一个文件夹或者文件。&lt;/p&gt;&lt;p&gt;&lt;strong&gt;第一种方法&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;rdiff-backup --restore-as-of(-r) [time] [备份目录] [恢复目录]&lt;/p&gt;&lt;p&gt;[time] 时间：&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;1.&amp;nbsp; now，当前的时间，最新的备份&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;2.&amp;nbsp; 日期时间格式的字符串，如“2002-01-25T07:00:00+02:00”&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;3.&amp;nbsp; Y、M、W、D、h、m、s（年、月、周、天、时、分、秒）&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;例如，“1h78m”表示一小时七八分钟前的时间，“3D”表示3天，“3W2D10h7s”表示3周、2天、10小时和7秒（23天10小时7秒）&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;4.&amp;nbsp; 格式为YYYY/MM/DD、YYYY-MM-DD、MM/DD/YYYY或MM-DD-YYYY的日期格式&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;例如：“2002/3/5”、“03-05-2002”和“2002-3-05”都是指2002年3月5日00:00:00。&lt;/p&gt;&lt;p style=&quot;text-indent: 2em;&quot;&gt;5.&amp;nbsp; NB，N为非负整数。例如“0B”指当前镜像的时间，“3B”指第三个最新增量。&lt;/p&gt;&lt;p&gt;[备份目录] 目录或文件&lt;/p&gt;&lt;p&gt;[恢复目录] 恢复到源服务器的指定目录或文件&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;使用-l/--list-incrememts查看可用的增量，然后指定还原的确切时间。&lt;/p&gt;&lt;p&gt;1.使用now恢复一个文件夹&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549520323602.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;2.按日期时间格式的字符串恢复，如“2002-01-25T07:00:00+02:00”，如下图&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549553609824.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549557145269.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;3.按 年-月-日 日期恢复&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549645236716.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549650295593.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;4.恢复“3B”第三个最新增量&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549708301624.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549717658960.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;第二种方法&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 宋体; font-size: 14px;&quot;&gt;rdiff-backup [增量文件] [恢复目录]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 宋体; font-size: 14px;&quot;&gt;[增量文件] 位于/备份目录/rdiff-backup-data/increments/目录中&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 宋体; font-size: 14px;&quot;&gt;[恢复目录]恢复到源服务器的指定目录或文件&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-indent:28px&quot;&gt;&lt;span style=&quot;font-family: 宋体; font-size: 14px;&quot;&gt;查找相应的增量文件。它将位于/backup/rdiff-backup-data/increments/目录中，其名称类似于“local.2002-11-09T12:43:53-04:00.dir”。请注意，增量文件都以“.diff”、“.snapshot”、“.dir”或“.missing”结尾，其中“.missing”仅表示该文件当时不存在（最后，其中一些文件可能是gzip压缩的，并有一个额外的“.gz”来表示这一点）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 宋体; font-size: 14px;&quot;&gt;恢复单个文件&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549781252710.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549848509369.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;恢复文件夹&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549870793623.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620549889466706.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&lt;strong&gt;注意事项：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;1.源文件、文件夹如果存在不能直接覆盖恢复，应该恢复到一个新的文件、文件夹。&lt;/p&gt;&lt;p&gt;2.按时间恢复时，如果指定的时间点没有备份，那将会恢复指定时间点上一份备份。如果没有上一份备份，则恢复最早的备份。&lt;/p&gt;&lt;p&gt;例如：如果设置的是“3D”，也就是恢复三天前的备份，但是只有2天前和4天前的数据，这时运行恢复会恢复到4天前；如果只有2天前的数据，运行恢复会恢复到2天前的数据。&lt;/p&gt;&lt;p&gt;3.测试恢复目录时出现不能新建两级目录的情况；恢复单个文件时不能新建目录，只能使用已有目录。&lt;/p&gt;&lt;p&gt;4.远端家目录不能使用~代替。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2&gt;删除旧备份&lt;/h2&gt;&lt;p&gt;1.&amp;nbsp; 按时间删除&lt;/p&gt;&lt;p&gt;此命令删除有关文件版本的最新信息，这些信息已存在两个星期了：&lt;/p&gt;&lt;p&gt;rdiff-backup --remove-older-than 2W host.net::/remote-dir&lt;/p&gt;&lt;p&gt;请注意，已有一年未更改的文件仍将保留。但是运行此命令后，无法还原15天前删除的文件。&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;2.&amp;nbsp; 按备份数量删除&lt;/p&gt;&lt;p&gt;与还原时一样，有多种方法可以指定时间。下面的“20B”告诉rdiff-backup只能删除过去20份新增备份之前的备份 rdiff-backup会话保存的信息。（nB 语法仅在0.13.1之后的版本中可用。）&lt;/p&gt;&lt;p&gt;rdiff-backup --remove-older-than 20B host.net::/remote-dir&lt;/p&gt;&lt;p&gt;删除前五个新增备份之前的备份&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620550235919883.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;注意事项：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;1.如果备份的时候没有文件改动，使用-l也无法查到这次备份记录，但是使用nB设置保留增量备份份数时，这一次也算一份增量备份。&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 例如：已有三份增量备份，第四次备份时没有文件改动，使用-l查看还是只有三份增量备份，再执行--remove-older-than 3B命令，这时使用-l查看就会发现就剩2份增量备份。&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://www.lpp521.com/zb_users/upload/2021/05/202105091620550303768260.png&quot; alt=&quot;image.png&quot;/&gt;&lt;/p&gt;</description><pubDate>Sun, 09 May 2021 15:26:20 +0800</pubDate></item><item><title>欢迎使用Z-BlogPHP！</title><link>https://www.lpp521.com/?id=1</link><description>&lt;p&gt;欢迎使用Z-Blog，这是程序自动生成的文章，您可以删除或是编辑它:)&lt;/p&gt;&lt;p&gt;系统生成了一个留言本和一篇《欢迎使用Z-BlogPHP！》，祝您使用愉快！&lt;/p&gt;</description><pubDate>Wed, 06 Jan 2021 11:36:57 +0800</pubDate></item></channel></rss><!--27.71 ms , 7 query , -427kb memory , 0 error-->