悲剧了,SUDO不好用了,怎么办?

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

悲剧了,SUDO不好用了,怎么办?

#1

帖子 8E117 » 2014-06-07 1:13

最近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呢?

谢谢大家!
使用Ubuntu单系统的菜鸟一枚:

Ubuntu入门中……
SuperCollider入门中……
Java入门中……
各种入门中……


菜鸟上路,请多多关照。
头像
8E117
帖子: 110
注册时间: 2014-01-30 12:08
系统: xubuntu 14.04

Re: 悲剧了,SUDO不好用了,怎么办?

#2

帖子 8E117 » 2014-06-07 2:48

在没有Google的情况下,一路用度娘,终于解决了问题!

原来恢复模式的文件系统是只读的。

用下面这个命令变成可以读写的:

代码: 全选

mount -rw -o remount /
使用Ubuntu单系统的菜鸟一枚:

Ubuntu入门中……
SuperCollider入门中……
Java入门中……
各种入门中……


菜鸟上路,请多多关照。
meditation
帖子: 217
注册时间: 2009-10-06 21:41
系统: ARCH

Re: 悲剧了,SUDO不好用了,怎么办?

#3

帖子 meditation » 2014-06-07 5:43

usermod -G 是修改用户组,添加用户到组用adduser user group
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 悲剧了,SUDO不好用了,怎么办?

#4

帖子 poloshiao » 2014-06-07 7:00

发现 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
上次由 poloshiao 在 2014-06-09 11:39,总共编辑 1 次。
头像
麦斯特
帖子: 1034
注册时间: 2005-03-28 0:00
系统: Gentoo x64
来自: ☸我佛山人

Re: 悲剧了,SUDO不好用了,怎么办?

#5

帖子 麦斯特 » 2014-06-07 11:04

添加用户到组,请用gpasswd。
Je ne suis pas d'accord avec ce que vous dites, mais je me battrai jusqu'à la mort pour que vous ayez le droit de le dire.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 悲剧了,SUDO不好用了,怎么办?

#6

帖子 poloshiao » 2014-06-07 12:15

添加用户到组,请用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.
回复