Cannot chdir into mountpoint.

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
whaha
帖子: 104
注册时间: 2016-07-08 17:43
系统: debian8

Cannot chdir into mountpoint.

#1

帖子 whaha » 2016-08-12 12:15

以前总是在root账户中使用命令,听人说不安全,于是将其中一个账户赋予了sudo权限,
全部在这个账户下运行命令,需要root权限运行时,就 sudo ,这下新问题来了,
每次执行命令后,总是出现
Cannot chdir into mountpoint.

请问,如何修复这个bug?
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Cannot chdir into mountpoint.

#2

帖子 poloshiao » 2016-08-12 14:27

每次执行命令后,总是出现
Cannot chdir into mountpoint.
摘要 只能當補充說明
請把 原始完整指令 及 終端機回應文字
全部複製 貼上來
whaha
帖子: 104
注册时间: 2016-07-08 17:43
系统: debian8

Re: Cannot chdir into mountpoint.

#3

帖子 whaha » 2016-08-14 15:43

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.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Cannot chdir into mountpoint.

#4

帖子 poloshiao » 2016-08-14 16:57

debian8@hwy:~$
于是将其中一个账户赋予了sudo权限
debian8 ALL=(ALL:ALL)ALL
這個就是你給予 debian8 赋予了 sudo 权限 的方法 ?
whaha
帖子: 104
注册时间: 2016-07-08 17:43
系统: debian8

Re: Cannot chdir into mountpoint.

#5

帖子 whaha » 2016-08-15 8:26

是哈,不是这样的话,正确做法是什么?
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Cannot chdir into mountpoint.

#6

帖子 poloshiao » 2016-08-15 8:38

正确做法是什么?
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
這一行移除
whaha
帖子: 104
注册时间: 2016-07-08 17:43
系统: debian8

Re: Cannot chdir into mountpoint.

#7

帖子 whaha » 2016-08-19 22:05

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.
whaha
帖子: 104
注册时间: 2016-07-08 17:43
系统: debian8

Re: Cannot chdir into mountpoint.

#8

帖子 whaha » 2016-08-19 22:08

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.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Cannot chdir into mountpoint.

#9

帖子 poloshiao » 2016-08-19 22:13

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 使用者 是權限最大者 ? 無所不能 ?
whaha
帖子: 104
注册时间: 2016-07-08 17:43
系统: debian8

Re: Cannot chdir into mountpoint.

#10

帖子 whaha » 2016-09-07 12:37

今天抽时间进行了反复测试,得到结论
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
回复