0
1

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.

Linux系PCでsudo ~~ 実行時にパスワード入力をなくす!

Last updated at Posted at 2020-11-11

個人所有のLinuxPCであれば,何かとsudo su したくなると思います.
毎回パスワード入力しても良いですが,打ち込むのだるくないですか?
何回も探すの面倒なので,ここにメモ代わりとして残して置きます.

お願い

各個人によってPCの使い方は人それぞれだと思います.
あくまでも以下に記載するのは私のPCにおける設定であり,各個人によっては設定をいじらないといけない場合もあるので,そこは自己責任でお願いします.

どこをいじるのか?(ユーザー情報が記録されているsudoersファイル)

$sudo visudo 
# sudoersファイルに記録されていません等のエラーが出る場合は
$su でroot権限になってください.

visudo内に以下の記述があると思います.

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "@include" directives:

@includedir /etc/sudoers.d

それを以下のように書き換える.

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL
username  ALL=NOPASSWD: ALL
# See sudoers(5) for more information on "@include" directives:

注意点

使用環境によってはPC立ち上げ時もめんどいから自動ログインでっ!
って方もいると思います.
そのような場合はPCの電源つけて$sudo su と打ち込まれたら何でもできてしまうので注意です.

※sudo権限(super user で do する権限)ってのが、PCの管理者権限になるので、sudo権限でPCを破壊することだってできちゃうので、怖いです...

便利さを追求していしまうとセキュリティガバガバ事案になることもあります.
そのへんは各自自己責任でお願いします.

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?