LoginSignup
10
6

More than 5 years have passed since last update.

ubuntu14.04でusermodしてsudoできなくなったとき

Last updated at Posted at 2015-11-11

やっちまった

ubuntuでusermodしてはいけない( http://d.hatena.ne.jp/thegoodbadugly/20130116/1358316032 )のを知らずにやらかしてしまったものの,先人たちのお知恵によって直せたのでメモ.

http://slumbers99.blogspot.jp/2011/06/ubuntu-usermod-g-admin.html
を参考にさせていただきました.
自分の環境だとちょっと違う部分があったのでそこを変えて書き留めておきます.

なおしかた

GRUBで
Advanced options for Ubuntu -> Ubuntu, with Linux *** (Recovery mode)
でリカバリーモードに入って,

root Drop to root shell prompt
でrootログインして,

mount -o remount,rw /
でRead/Writeモードで再マウントして
(http://qiita.com/ironsand/items/f40581705a7bb402c01d を参考にさせていただきました)

usermod -G adm,dialout,cdrom,plugdev,lpadmin,sudo,(ユーザー名) (ユーザー名)
でグループに追加

su (ユーザー名)でそのユーザーになってみて,
sudo cat /etc/groupとかやってみてsudoできるか確認.

10
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
6