分页: 1 / 1
悲剧了,SUDO不好用了,怎么办?
发表于 : 2014-06-07 1:13
由 8E117
最近Google一直上不去,
站内搜索也就没法用了……估计这个问题曾经可能有人遇到并解决过……
我使用下面这个命令,将我的添加到了一个组里面……
sudo usermod -G grop xxx
然后重新启动……发现sudo不好用了!
xxx is not in the sudoers file. This incident will be reported.
通过恢复模式,终于看到了亲切的#,可是使用usermod -aG sudo xxx
然后它说:
cannot lock /etc/passwd
有人说删除掉.pwd.lock文件就好了,
可是我rm .pwd.lock
说这个文件只读,不能删除……
使用chmod还不好使……
现在我应该怎么让我的账户可以使用sudo呢?
谢谢大家!
Re: 悲剧了,SUDO不好用了,怎么办?
发表于 : 2014-06-07 2:48
由 8E117
在没有Google的情况下,一路用度娘,终于解决了问题!
原来恢复模式的文件系统是只读的。
用下面这个命令变成可以读写的:
代码: 全选
mount -rw -o remount /
Re: 悲剧了,SUDO不好用了,怎么办?
发表于 : 2014-06-07 5:43
由 meditation
usermod -G 是修改用户组,添加用户到组用adduser user group
Re: 悲剧了,SUDO不好用了,怎么办?
发表于 : 2014-06-07 7:00
由 poloshiao
发现 sudo 不好用了!
sudo 不好用
沒有 sudo 就不會用 ubuntu 了
sudo usermod -G group xxx
1. 新舊帳號
usermod 使用在 已經存在的帳號
useradd 使用在 新增加的帳號
2. 參數
-G supplementary group
-g primary group
3. 進一步參閱
http://www.go2linux.org/change-add-user-to-group
Re: 悲剧了,SUDO不好用了,怎么办?
发表于 : 2014-06-07 11:04
由 麦斯特
添加用户到组,请用gpasswd。
Re: 悲剧了,SUDO不好用了,怎么办?
发表于 : 2014-06-07 12:15
由 poloshiao
添加用户到组,请用gpasswd。
http://www.linuxquestions.org/questions ... ost5033168
1. gpasswd -a user group
simply adds a user to the group
2. usermod -g user group
makes the group the users primary group
3. usermod -G user group
makes the group the users supplementary group
4. group 與 primary group 與 supplementary group 有何不同
http://linuxers.org/article/difference- ... oups-linux
The difference between Primary and Secondary groups in Linux
簡單說 關係到目錄及文件檔案的群組權限 需要設定其所屬的群組為 Primary 或 Secondary groups.