LoginSignup
1
1

More than 3 years have passed since last update.

【Linux】Proxy適用

Last updated at Posted at 2020-07-17

LInuxのネットワークにプロキシを経由する方法メモ。
OSはCentOS。


/etc/profileに以下を追記します。

/etc/profile
PROXY='http://username:password@proxy-serverのIPかhostname:8080'
export http_proxy=$PROXY
export HTTP_PROXY=$PROXY
export https_proxy=$PROXY
export HTTPS_PROXY=$PROXY

ポートは置き換えてください。
認証がない場合はusername:password@の部分は不要です。


反映

source /etc/profile

確認
printenv

ちなみにproxypac等を利用していた場合に、PROXYにpacのパスをそのままいれても効かないので注意です。

ユーザ毎に設定したい場合は、bashrc、.bash_profileに。
yumの行先をプロキシにしたい場合は/etc/yum.confに記述すればOKです。


以上

1
1
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
1
1