Centos 复制文件【文件授权】

本文详细解释了在Linux系统中遇到'无法创建常规文件'错误的原因及解决方案,着重强调了权限问题和使用'su'命令切换为root身份进行操作的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

cp: cannot create regular file `/usr/sbin/ddclient': Permission denied

Most users cannot write outside their own home directory by default (except in places like /var/tmp, /tmp and other temporary directories). This means that you need to be root in order to copy that file to /usr/sbin. Also note that if you copy that file to /usr/sbin only root will be able to use it without entering the full path of the command because */sbin directories are not usually in the path of normal users.

--------------

以上摘自网络: 红色部分:大多数用户不能将文件写到除了用户目录以外的地方。

own home directory 每个linux 系统下都用自己的一个 用户目录。

/home/user_name

在 centos 中如果想要把 home 目录下的文件复制到 其他目录

会提示 cannot create regular filexxxxPermission denied

解决办法: su 回车 【以root身份操作】

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值