ターミナルでルートとはどういう意味ですか?

ターミナルでルートとはどういう意味ですか?

違いは何ですか?

私のOSには2つのアカウントがあります。男爵そして

baronアカウントを使用してログインし、コマンドを実行しました。sudo -s

baron@linux:~@ sudo -s 
[sudo] password for baron:
root@linux:~@/home/baron#

ログアウトしてルートアカウントを使用してログインすると、端末に次のものが表示されます。

root@linux:~@

では、別のアカウントでログインしても端末に同じ内容が表示されるのはなぜですか?

ベストアンサー1

プロンプトにユーザー、ホスト名、および現在のディレクトリが表示されます。

user@hostname:/current/dir $

sudo一般ユーザーとしてコマンドを実行する場合(男爵あなたの場合)システムに「何か」をrootにするか、root権限を持つようにコマンドを提供します。ルート定義の表示

このオプションを使用すると、コマンドは指定されていないため、対話式シェル環境のユーザーに-sなるコマンドを実行します。root

- からman sudo

-s [command]
               The -s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in the password database.  If a command is specified, it is passed to the shell for execution
               via the shell's -c option.  If no command is specified, an interactive shell is executed.

その後、ログインするとrootデフォルトアカウントがsudoだから、まったく実行する必要はありません

おすすめ記事