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?

Ubuntuでsudo権限のあるユーザを追加する

Posted at

いつも忘れてしまうので、備忘録メモ。

普段はMacBookAirを使っているのですが、たまにUbuntuやWindowsを使う場面があってParallelsをインストールして、その仮想環境の中でUbuntuやWindowsを使っています。
たまにしか使わないので、ubuntuなどを再インストールしたときにsudo権限のついたユーザを追加する方法を忘れがちなのでメモりました。

ユーザの追加自体は自分が大昔にUnixなどを触っていた時代と変わらないので忘れませんが、その時代は su - でルートになって作業していた覚えがあるんですよね。
sudoというコマンド自体もなかったのか使っていなかったのか...。

ユーザ追加
parallels@ubuntu-linux-2404:~$ sudo adduser nomura
[sudo] password for parallels: 
info: Adding user `nomura' ...
info: Selecting UID/GID from range 1000 to 59999 ...
info: Adding new group `nomura' (1001) ...
info: Adding new user `nomura' (1001) with group `nomura (1001)' ...
info: Creating home directory `/home/nomura' ...
info: Copying files from `/etc/skel' ...
New password: 
Retype new password: 
passwd: password updated successfully
Changing the user information for nomura
Enter the new value, or press ENTER for the default
	Full Name []: NOMURA Toshiaki
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n] y
info: Adding new user `nomura' to supplemental / extra groups `users' ...
info: Adding user `nomura' to group `users' ...

追加したユーザにsudo権限をつけます。

sudo権限をつける
parallels@ubuntu-linux-2404:~$ sudo gpasswd -a nomura sudo
Adding user nomura to group sudo

以上です。

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?