linux – 整个文件系统的备份权限

这是瘦的:我有一个Linode VPS,我想通过rsync备份到我的本地笔记本电脑.我刚刚为通信生成了ssh密钥,并为私钥留下了一个空白密码,因此我可以通过cron进行rsync,而无需担心密码.

为了更加安全,我还拒绝了root ssh登录.理想情况下,我希望从/向下备份所有内容,但除非我给特定用户rwx访问所有内容,否则使用普通用户根本不可能.

在不允许root登录的情况下,通过rsync备份整个文件系统的最佳方法是什么?

解决方法

使用root帐户:只有uid 0才能读取整个文件系统.

现在,由于您希望提高安全性,以下是您可以执行的操作:

>禁止root通过ssh使用密码登录(sshd config中的PermitRootLogin无密码).
>使用密钥身份验证进行备份.

根据man 5 sshd_config

"     PermitRootLogin
             Specifies whether root can log in using ssh(1).  The argument
             must be ``yes'',``without-password'',``forced-commands-only'',or ``no''.  The default is ``yes''.

             If this option is set to ``without-password'',password
             authentication is disabled for root.

             If this option is set to ``forced-commands-only'',root login
             with public key authentication will be allowed,but only if the
             command option has been specified (which may be useful for taking
             remote backups even if root login is normally not allowed).  All
             other authentication methods are disabled for root.

             If this option is set to ``no'',root is not allowed to log in."

从未尝试过“强制命令”参数,但它看起来很有趣.

相关文章

insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...