简体   繁体   English

Linux-如何更改/的chmod

[英]Linux - how change chmod of /

How can I change chmod of /? 如何更改/的chmod?

When I run 当我跑步

chmod 755 /

under root, I get 在根下,我得到

Operation not permitted

Why I need it? 我为什么需要它?

I am installing (logged as root) apt-get install memcached and I get error: 我正在安装(以root身份登录) apt-get install memcached ,但出现错误:

failed to move /initrd.img:Permission denied at /var/lib/dpkg/info/linux-image-3.2.0-26-generic.postinst line 495.

I suppose that your root filesystem is mounted readonly. 我想您的根文件系统是只读安装的。 You need to check it, for example, creating a file in /root : 您需要检查它,例如,在/root创建一个文件:

# touch /root/hello

Then you will see if it is really so. 然后,您会看到是否确实如此。

If it mounted readonly, you can try to remount it rewrite and see what happened: 如果以只读方式挂载,则可以尝试以重写方式重新挂载并查看发生了什么:

# mount -o rw,remount /

Ok, how we've known after the discussion there were an immutable bit on the filesystem. 好的,我们在讨论后如何知道文件系统上有一个不可更改的位。

# lsattr -d /
----i--------e- /

You can remove this bit with chattr -i / . 您可以使用chattr -i /删除此位。 Don't forget to set it back after your operations: 操作完后,请不要忘记重新设置它:

# chattr -i /
# # something
# chattr +i /

Do you have root privileges? 您有root特权吗? Mere mortals (ie, regular users :-) are not permitted to make these changes 凡人(即普通用户:-)均不得进行这些更改

尝试使用为您提供超级用户特权的sudo,就像其他人会提到的那样,这种东西就像巫术,如果它发生了严重错误,那么至少可以说您的系统将“不稳定”。

Apt-get doesn't need to change permissions for / or first degree children. Apt-get不需要更改/或一级孩子的权限。 Which command do you 你是哪个命令

use yum tools for installing it automatically clear all the permission and other installing problems . 使用yum工具安装它会自动清除所有权限和其他安装问题。 use this command 使用此命令
1. Login as root 1.以root身份登录
2. change permissions of \\ 2.更改权限
chmod 777 * chmod 777 *
3.install bmemcached 3.安装bmemcached
* yum install bmemcached** *百胜安装bmemcached **

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM