加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 无法写入其他用户“您已关闭写入权限”

发布时间:2020-12-13 17:03:32 所属栏目:Linux 来源:网络整理
导读:出于某种原因,我无法写入我系统上的其他用户. [root@hostname ~]# writewrite: you have write permission turned off.[root@hostname ~]# mesg y[root@hostname ~]# mesgis y[root@hostname ~]# writewrite: you have write permission turned off. 还需要
出于某种原因,我无法写入我系统上的其他用户.
[root@hostname ~]# write
write: you have write permission turned off.
[root@hostname ~]# mesg y
[root@hostname ~]# mesg
is y
[root@hostname ~]# write
write: you have write permission turned off.

还需要启用/纠正其他什么工作?

解决方法

测试strace write和strace mesg显示他们识别你的tty的方式略有不同.

write将首先执行readlink(“/ proc / self / fd / 0”,…)以查找tty的名称,然后在生成的路径上执行stat调用.

另一方面,mesg将调用fstat(1,…),它会跳过使用readlink的步骤而不依赖于/ proc文件系统.

请注意,它们还会查看不同的文件描述符0 vs 1.通常,交互式shell将具有引用相同tty的文件描述符0,1和2.如果你以某种方式使你的shell运行0和1引用不同的东西,例如,如果你重定向其中一个,这可以解释mesg和write的输出之间的差异.

如果文件描述符都引用相同的tty,则差异的另一个可能原因可能是您的/ proc安装程序没有按预期运行或者您的tty的字符设备inode已被替换.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读