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

suとsudo

Posted at
  • 半年以上前の編集中の記事が残っていたのであげる

suコマンド(最強コマンド)

  • 一般的なsuの使い方の場合ユーザはroot権限を一時的に使えるようになる。プロンプトは「#」になりexitするまで持続する。

  • su使用時にきかれるパスワードは「rootのパスワード」である。

  • もしシステム管理者があなたしかいないのならばsuで問題ないかもしれないが、他人と共有する場合、他人にrootパスワードを知らせることになる。

sudoコマンド

  • sudoはコマンド単位で一時的にroot権限を使う方法だ。「スーパーユーザでDoするからsudo」という意味合いで覚えておこう。

  • 必要なパスワードは「あなたのパスワード」である。

  • コマンド単位で「誰にどのコマンドをrootで実行させることを許可するか」を指定できる。こうすることでrootパスワードを知られることなく、必要なコマンドをroot権限で実行できるようになる。

  • もちろん無差別に権限を割り振ってしまうと意味がなくなるので注意していただきたい。sudoを使うには、一度スーパーユーザになってから「visudo」コマンドで設定ファイルを編集しなければならない。

参考

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