warning: Insecure world writable dir /usr/local/lib/nodejs in PATH, mode 040777

运行rails c、rails -v或者rails server的时候都会出现下面的错误 :

image-20210826094714670

warning: Insecure world writable dir /usr/local/lib/nodejs/node-v14.16.1-linux-x64/bin in PATH, mode 040777

虽然不影响使用,但看着很不爽,777是权限全开,随便哪个人都可以访问,读取、写入,自然会报警,解决办法:

sudo chmod go-w -R /usr/local/lib/nodejs

一切正常了:

image-20210826094824524

服务器也没毛病了:

image-20210826094904419

chmod中的g表示在组中的其它用户,o表示不在此组中的用户,-w表示去掉写权限,相关chmod的原英文解释如下:

A combination of the letters ugoa controls which users’ access to the file will be changed: the user who owns it
(u), other users in the file’s group (g), other users not in the file’s group (o), or all users (a). If none of these are given, the effect is as if (a) were given, but bits that are set in the umask are not affected.

The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory’s unmentioned set user and group ID bits are not affected.

想要查看更多chmod的使用方法,可以在linux服务器中输入

man chmod
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱玩的安哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值