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 5 years have passed since last update.

rootユーザでログインしたことが分かるようにする。

Last updated at Posted at 2016-09-07

rootユーザでログインした時に、プロンプトの文字列を赤くする。

rootユーザの.profileに以下を記載。

.profile
export PS1="\e[31m\e[40m\][\u@\h \t]\\$\[\e[0m\] "

rootユーザでログインした時に、メッセージを表示する。

rootユーザの.profileに以下を記載。

.profile
msg='\e[31m------
警告!
------
rootユーザでログインしています。
操作には十分注意してください。
必要のない場合は、すぐにログアウトしてください。
\e[0m'
echo -e "$msg"
unset msg

以上

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?