当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 10 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : Cannot chdir into mountpoint.
帖子发表于 : 2016-08-12 12:15 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
以前总是在root账户中使用命令,听人说不安全,于是将其中一个账户赋予了sudo权限,
全部在这个账户下运行命令,需要root权限运行时,就 sudo ,这下新问题来了,
每次执行命令后,总是出现
Cannot chdir into mountpoint.

请问,如何修复这个bug?


页首
 用户资料  
 
2 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-12 14:27 

注册: 2009-08-04 16:33
帖子: 16891
送出感谢: 21
接收感谢: 1826
引用:
每次执行命令后,总是出现
Cannot chdir into mountpoint.

摘要 只能當補充說明
請把 原始完整指令 及 終端機回應文字
全部複製 貼上來


页首
 用户资料  
 
3 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-14 15:43 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
cat /etc/sudoers
root ALL=(ALL:ALL) ALL
debian8 ALL=(ALL:ALL)ALL

debian8@hwy:~$ id $USERNAME
uid=1000(debian8) gid=1000(debian8) groups=1000(debian8),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),111(sc anner),117(lpadmin)

debian8@hwy:~$ sudo find / -name 'vimrc'
Cannot chdir into mountpoint.
/home/debian8/openwrt/feeds/packages/utils/vim/files/vimrc
/root/openwrt/feeds/packages/utils/vim/files/vimrc
/usr/share/vim/vimrc
/etc/vim/bundle/Vundle.vim/test/vimrc
/etc/vim/bundle/vundle/test/vimrc
/etc/vim/vimrc
Cannot chdir into mountpoint.


页首
 用户资料  
 
4 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-14 16:57 

注册: 2009-08-04 16:33
帖子: 16891
送出感谢: 21
接收感谢: 1826
引用:
debian8@hwy:~$

引用:
于是将其中一个账户赋予了sudo权限

引用:
debian8 ALL=(ALL:ALL)ALL

這個就是你給予 debian8 赋予了 sudo 权限 的方法 ?


页首
 用户资料  
 
5 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-15 8:26 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
是哈,不是这样的话,正确做法是什么?


页首
 用户资料  
 
6 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-15 8:38 

注册: 2009-08-04 16:33
帖子: 16891
送出感谢: 21
接收感谢: 1826
引用:
正确做法是什么?

1. 把 debian8 加入 sudo 群組
1-1. 如果有困難 請再貼文

2. sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
... 以下省略
2-1. 避免直接修改 /etc/sudoers
2-2. 記得 把
debian8 ALL=(ALL:ALL)ALL
這一行移除


页首
 用户资料  
 
7 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-19 22:05 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
1.debian8已经加入root组
cat /etc/group |grep "debian8"
root:x:0:debian8
debian8:x:1000:

2.debian8 ALL=(ALL:ALL)ALL已经注销


debian8@hwy:~$ sudo find / -name 'vimrc'
[sudo] password for debian8:
Sorry, try again.
[sudo] password for debian8:
debian8 is not in the sudoers file. This incident will be reported.


页首
 用户资料  
 
8 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-19 22:08 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
1.debian8已经加入root组
cat /etc/group |grep "debian8"
root:x:0:debian8
debian8:x:1000:


debian和ubuntu不一样,dbeian8要在root组中,/etc/sudoers必须有这句话,请查相关资料。
debian8 ALL=(ALL:ALL)ALL

如果注销这句话,debian8 ALL=(ALL:ALL)ALL
debian8@hwy:~$ sudo find / -name 'vimrc'
[sudo] password for debian8:
Sorry, try again.
[sudo] password for debian8:
debian8 is not in the sudoers file. This incident will be reported.


页首
 用户资料  
 
9 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-08-19 22:13 

注册: 2009-08-04 16:33
帖子: 16891
送出感谢: 21
接收感谢: 1826
引用:
debian和ubuntu不一样,dbeian8要在root组中,/etc/sudoers必须有这句话,请查相关资料。

1. 你在哪裡 看到這一句話 ? 請提供網址.
引用:
debian8已经加入root组
cat /etc/group |grep "debian8"
root:x:0:debian8

2. https://wiki.debian.org/sudo
Configuration overview
/etc/sudoers
%sudo ALL=(ALL:ALL) ALL
2-1. 在 /etc/sudoers
預設
只有 %sudo (sudo 群組)
沒有 %root (root 群組)
引用:
1. 把 debian8 加入 sudo 群組

2-2. 加入 sudo 群組
不是 加入 root 群組
因為 在 /etc/sudoers
沒有定義 %root (root 群組)

3. sudo 群組 與 root 使用者 權限定義稍有不同
3-1. 參見
https://wiki.debian.org/sudo
/etc/sudoers
%sudo ALL=(ALL:ALL) ALL
root ALL=(ALL) ALL
3-2. ALL=(ALL:ALL) 跟 ALL=(ALL) 有何不同 ?
http://askubuntu.com/a/43344
No security difference.
Both have 100% unrestricted access to anything provided by the OS.
The difference in your /etc/sudoers is (ALL) vs (ALL:ALL). The first one means you can run commands as any user. The second - you can run command as any user and as any group.
3-2-1. 意思是
root 使用者 可以扮演任何使用者執行指令
sudo 群組 可以扮演任何使用者及任何群組執行指令
顯然 root 使用者 的權限
屬於 sudo 群組的成員 也都有
sudo 群組的成員 還多一點點權限 是 root 使用者所沒有的
3-3. 你還堅持 root 使用者 是權限最大者 ? 無所不能 ?


页首
 用户资料  
 
10 楼 
 文章标题 : Re: Cannot chdir into mountpoint.
帖子发表于 : 2016-09-07 12:37 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
今天抽时间进行了反复测试,得到结论
1。debian的/etc/sudoers
# User privilege specification
root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
默认设置不是 root ALL=(ALL) ALL

2。四个ALL的含义
https://serversforhackers.com/video/sud ... figuration


3。debian下面赋予普通用户root权限
只需要在/etc/sudoers写入
username ALL=(ALL:ALL) ALL
无需将username加入root组或者sudo组。


附件:
root.png
root.png [ 28.41 KiB | 被浏览 234 次 ]

页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 10 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译