Discuz! BBS

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 552|回复: 0

stat查看目录属性

[复制链接]

254

主题

363

帖子

2431

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2431
发表于 2024-8-4 20:18:56 | 显示全部楼层 |阅读模式
以root用户执行systemctl命令报权限相关问题

[root@hps2 ~]# systemctl stop hps-manager

* (pkttyagent:10364): WARNING *: Unable to register authentication agent: GDBus.Errorrg.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files
Error registering authentication agent: GDBus.Errorrg.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files (g-dbus-error-quark, 2)
以root用户切换到普通用户下报错:
[root@hps2 ~]# useradd aihps
[root@hps2 ~]# su - aihps
su: warning: cannot change directory to /home/aihps: Permission denied
su: failed to execute /bin/bash: Permission denied

解决方法

[root@hps2 ~]# stat /
File: ‘/’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fd01h/64769d Inode: 2 Links: 23
Access: (0600/drw——-) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-05-30 09:54:45.692000000 +0800
Modify: 2016-05-25 15:41:46.204000000 +0800
Change: 2016-05-25 15:41:46.204000000 +0800
Birth: -
问题出来了,这里的权限是错误的,X权限的丢失造成的。

[root@localhost ~]#chmod 755 /
修改后,问题消失。

产生上述问题的操作:
第一种,chmod 666 /,可以导致。
或者,
第二种,chmod 700 /lib/ld-xxxx.so,也可以导致su失败。
有兴趣可以自己试一下。

/权限的丢失对于各种运行在自己用户身份上的daemon也存在同样的影响。 参考文章:http://blog.itpub.net/9606200/viewspace-745674/

原文链接:https://blog.csdn.net/huangjin0507/article/details/51536454



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|DiscuzX

GMT+8, 2025-4-16 04:21 , Processed in 0.014803 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表