UJP - /etc/bashrcを編集

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ サイト構築 の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - /etc/bashrcを編集

/etc/bashrcを編集

カテゴリ : 
サイト構築
ブロガー : 
ujpblog 2018/4/4 23:00
 サーバ全体のユーザのbashrcを設定するために,テンプレートファイルを編集する.

 環境設定ファイルをバックアップする.
zeus:~ ujpadmin$ ls -la /etc/bashrc🆑
-r--r--r--  1 root  wheel  265  7 16  2017 /etc/bashrc
zeus:~ ujpadmin$
zeus:~ ujpadmin$ sudo cp -p /etc/bashrc /etc/bashrc.20180403🆑
Password:
zeus:~ ujpadmin$
zeus:~ ujpadmin$ ls -la /etc/bashrc🆑
-r--r--r--  1 root  wheel  265  7 16  2017 /etc/bashrc
zeus:~ ujpadmin$
zeus:~ ujpadmin$ ls -la /etc/bashrc.20180403🆑
-r--r--r--  1 root  wheel  265  7 16  2017 /etc/bashrc.20180403
zeus:~ ujpadmin$
zeus:~ ujpadmin$ diff /etc/bashrc /etc/bashrc.20180403🆑
zeus:~ ujpadmin$
環境設定ファイルの中身を確認.
zeus:~ ujpadmin$ cat /etc/bashrc🆑
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
zeus:~ ujpadmin$
 これをみるとetc/bashrc_にファイルがある模様.
zeus:~ ujpadmin$ ls -la /etc/bashrc.*🆑
-r--r--r--  1 root  wheel  265  7 16  2017 /etc/bashrc.20180403
zeus:~ ujpadmin$ ls -la /etc/bashrc*🆑
-r--r--r--  1 root  wheel   265  7 16  2017 /etc/bashrc
-r--r--r--  1 root  wheel   265  7 16  2017 /etc/bashrc.20180403
-rw-r--r--  1 root  wheel  9192 10 11 09:48 /etc/bashrc_Apple_Terminal
-r--r--r--  1 root  wheel   265  8  2  2015 /etc/bashrc~previous
zeus:~ ujpadmin$
 次のように追加.
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"

🈁
#PATH 20180131
export PATH="/usr/local/opt/openssl/bin:$PATH"
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/apr-util/bin:$PATH"
export PATH="/usr/local/opt/apr/bin:$PATH"
export PATH="/usr/local/opt/openssl/bin:$PATH"
export PATH="/usr/local/opt/gettext/bin:$PATH"
export PATH="/usr/local/opt/curl/bin:$PATH"

#man 20180131
export MANPATH="/usr/local/opt/gnu-sed/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/gnu-tar/libexec/gnuman:$MANPATH"

#Prompt
PS1='\h:\u \t \w \n\$ '
export COWPATH=/usr/local/Cellar/cowsay/3.04/share/cows
cowsay -f bud-frogs `hostname`
🈁
 さて.リモートからログインしてみる.
MBP2017:~ ujpadmin$ ssh ujpadmin@zeus.local🆑
Password:
Last login: Tue Apr  3 15:56:11 2018 from c2%en3
 ____________
< zeus.local >
 ------------
     \
      \
          oO)-.                       .-(Oo
         /__  _\                     /_  __\
         \  \(  |     ()~()         |  )/  /
          \__|\ |    (-___-)        | /|__/
          '  '--'    ==`-'==        '--'  '
zeus:ujpadmin 16:40:17 ~
$
 でました.

トラックバック


広告スペース
Google