0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

usermodコマンドでユーザ名が変えられない(VirtualBox使用している人なら陥るかも)

Last updated at Posted at 2021-05-07

こんにちは、tanzoです。

本日は、Virtual Box初心者なら陥ってしまうかもしれないような部分を紹介したいと思います。 → 多分、陥るのは初心者でも僕くらいだと思いますね笑笑

usermodコマンドでユーザ名が変えられない

タイトルにもあると思うんですが、usermodが使えない!という方向けの記事です。

さっそくコマンド見ていきましょか

コマンド

[root@localhost ~]# usermod -l hoge moge  →  usermod -l 新しい名前 古い名前
usermod: user moge is currently used by process xxxx → xxxxは各自のPid

上記は色々な記事でも取り上げられていて、mogeというユーザで何らかのプロセスが実行していて、名前変えられないよっていうエラーなのですが、自分の場合はプロセスを止めちゃえばいいんじゃない?って思って、以下のコマンド試しましたが、ダメでした。

コマンド

[root@localhost ~]# kill xxxx   →    xxxxは各自のPid

原因はなんだったのか?

簡潔に言いますと、teratermとvirtualboxに同時にログインして、どちらかをmogeという名前のユーザでログインしていたことが原因でした。。。。。

→ mogeでログインしてるってことはmoge使ってるってことだよね

最後に

自分はいつもVirtualBoxでログインした状態でteraterm立ち上げてログインするという謎の癖(癖の理由は話せば長いです笑)があったので、これからはteratermだけログインするということを心掛けたいと思います。。。

参考文献

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?