リモートSSH接続は.profileで定義されている属性をロードしません。

リモートSSH接続は.profileで定義されている属性をロードしません。

以下のように、ボックスにリモートSSH接続を作成してコマンドを実行しています。

ssh <userid>@<hostname> 

スクリプトを実行すると、.profileで定義された値が正しくロードされません。

しかし、ボックスに直接ログインすると正常に動作します。

誰でも助けることができますか?

ベストアンサー1

man ssh以下の各州から抜粋したように、

When the user's identity has been accepted by the server, the server
either executes the given command in a non-interactive session or, if no
command has been specified, logs into the machine and gives the user a
normal shell as an interactive session.

.profile対話型ログインシェルでは読み取り専用です。だからすべてが大丈夫です。見てこの回答。対話型シェルとは何かを説明します。

おすすめ記事