sshでログインしてシェルを変更する

<目的>

大学のパソコンにsshで入ったのちに、bashに切り替える。
そして、".bash_profile" の中でPATHが定義されているanacondaを使えるようにする。

 

(1)ログイン時のシェルを調べる

% echo $SHELL
/bin/tcsh

=== tcshであることがわかる。


(2)利用できるシェルの種類を調べる

% cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh


(3)bashに切り替える

% bash
bash-3.2$


(4)そのままの状態でPYTHONPATHを調べる

bash-3.2$ echo $PYTHONPATH
[何も表示されない]


(5).bash_profileを読み込ませる


bash-3.2$ source .bash_profile
bash-3.2$ echo $PYTHONPATH
:/usr/local/anaconda/lib/python2.7/site-packages/