为什么我应该为我的 tty 设置写权限才能使用 write cmd?
write
命令的目的是向登录到 tty 的用户发送消息。为了使该命令起作用,接收者应该在他的 tty 上为该组设置写权限。这是必要的,因为:
/dev/ttyXXX
属于 tty 组write
命令将 SGID 与 tty 组一起使用,让用户有机会写入某人的 tty
好的。现在,如果发送者没有为自己的 tty 设置写入权限,他就无法向其他人的 tty 写入数据。 我看不出有任何技术依据!这只是为了保持某种礼貌吗?即使在这种情况下,为什么 wall
命令不遵循相同的原则?任何人都可以使用 wall,而他的 mesg
说 n....
我错过了什么吗?
The purpose of the write
command is to send msg to a user logged in a tty. In order for this command to work, the receiver should set write permission on his tty for the group. This is necessary since:
- the
/dev/ttyXXX
belongs to the tty group - the
write
command is using SGID with the tty group to let users have a chance to write to someone's tty
Ok. Now, if the sender don't set write permission for his own tty, he can't write to someone else tty's.
I can't see any technical grounds for this! Is this just to preserve some kind of politeness? And even in this case, why does the wall
command don't follow the same principle? Anyone can use wall while his mesg
says n....
Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
write 的含义是它是双向通信。
从手册页:
如果收件人想要回复,可以通过以下方式完成
输入消息
我认为您不会高兴地看到其他用户能够向您的终端发送垃圾邮件文本而不受到您的报复/回复。将其视为理智要求。
The implication of write is that it is two way communication.
From the man page:
If the recipient wants to reply, this can be accomplished by
typing a message
I don't think you would be pleased to have some other user able to spam text to your terminal without reprisal/reply from you. Think of it as a sanity requirement.