git 프록시 설정(proxy setting)은 아래와 같다.

$ git config --global http.proxy [프록시서버주소:포트]
$ git config --global https.proxy [프록시서버주소:포트]

 

e.g.) git config --global https.proxy http://10.10.10.10:8080

 

proxy server를 경유할 경우 높은 확률로 https 인증 실패를 당하므로

$ git config http.sslVerify false

 

도 함께 해주는 것이 좋다.

 

참고로 기등록된 proxy 주소가 있는지 알고 싶다면 아래 명령으로 확인 가능하다.

$ git config --global --get http.proxy
$ git config --global --get https.proxy

$ git config --global --get http.sslVerify

반응형

'Linux > Proxy' 카테고리의 다른 글

Proxy setting, curl  (0) 2023.05.28
Proxy setting, date - Proxy가 있을 때 시간 동기화  (0) 2020.06.11
Proxy setting, npm (ubuntu 18.04)  (0) 2020.04.06
Proxy setting, jupyter notebook  (0) 2020.02.06
Proxy setting, conda (Windows)  (0) 2019.12.08

□ 환경

- ubuntu18.04, 20.04

- python 3.7 이상

 

프록시(proxy)가 설치되어 있는 환경에서 docker를 사용할 때, 

docker container 를 실행시킨 후 컨테이너 내부에 패키지들을 설치하기 위해 apt-get update를 실행시키면 메세지와 함께 package list가 update 되지 않는 경우가 있다. 당연히 다른 패키지들을 설치할 수도 없다.

$ apt-get update

...

connection timed out

 

이 경우 여러 원인이 있겠으나 대개의 경우 docker container 안에 proxy setting이 안되어 있는 경우로 proxy 설정을 해주면 해결되는 경우가 많다. 하기 링크에서 설정 가능하다.

https://driz2le.tistory.com/272

 

Proxy setting, apt-get (ubuntu 18.04)

Ubuntu 포함 linux 기본 환경에서 apt 또는 apt-get 에 대한 proxy 설정방법이다. Docker 환경에서 container 안에서 proxy를 설정해야할 경우에도 똑같이 적용하면 된다. 다만, docker container 안에서는 proxy가 안

driz2le.tistory.com

 

apt-get update도 안되는 상황이면 보통 vi 도 설치가 되지 않았을 가능성이 크므로, 이때는

$ sudo echo 'Acquire::http::proxy "http://10.10.10.10:8080/";' > /etc/apt/apt.conf.d/90proxy

$ sudo echo 'Acquire::https::proxy "http://10.10.10.10:8080/";' >> /etc/apt/apt.conf.d/90proxy

// 정상적으로 기록되었는지 확인

$ sudo cat /etc/apt/apt.conf.d/90proxy

Acquire::http::proxy "http://70.10.15.10:8080/";
Acquire::https::proxy "http://70.10.15.10:8080/";

 

위에서 10.10.10.10:8080 은 자신의 proxy server ip나 url을 사용하면 되며 90proxy 파일명은 어떤 이름이든 상관없다.

반응형

curl은 인터넷 상에서 데이터 전송을 위해 사용하는 command line 도구로, https, https, FTP, SFTP 등 다양한  protocols를 지원한다. 따라서, 프록시(proxy) 서버가 설치된 경우, curl 명령을 제대로 사용하려면 proxy 를 명시해야 하는 경우가 있다. 아래와 같은 명령을 사용한다.

curl -x proxy.com:8080 
     -U login:password

당연히 proxy.com 대신 1.2.3.4:8080 처럼 프록시 서버의 IP로 기재하는 것도 가능하다.

 

반응형

'Linux > Proxy' 카테고리의 다른 글

Proxy setting, git  (0) 2023.06.04
Proxy setting, date - Proxy가 있을 때 시간 동기화  (0) 2020.06.11
Proxy setting, npm (ubuntu 18.04)  (0) 2020.04.06
Proxy setting, jupyter notebook  (0) 2020.02.06
Proxy setting, conda (Windows)  (0) 2019.12.08

Jupyter Notebook에서 Proxy 세팅 방법

 

□ 소스에서 직접 Setting

import os

os.environ['HTTP_PROXY']   =  'http://ip:port'
os.environ['HTTPS_PROXY'] =  'https://ip.port'

 

이때 https의 경우 http를 사용하는지 확인이 필요하다.

본인이 있는 곳의 환경 구성에 따라서 https 연결에서도 proxy는 http를 동일하게 사용하는 곳도 있기 때문이다. 

당연한 이야기겠지만, https의 s 한자만 빠지거나 붙어도 연결이 안되는 경우가 발생한다.

 

또한, Proxy 서버 연결을 위해서 사용자 인증이 필요하다면 아래와 같이 설정한다.

import os

os.environ['HTTP_PROXY']    = "http://user:passwd@ip:port"

os.environ['HTTPS_PROXY']  = "https://user:passwd@ip:port"

 

□ 소스에서 직접 Setting 사용 예(pytorch)

import torch

import os

os.environ['HTTP_PROXY']   =  'http://10.10.10.10:8080'
os.environ['HTTPS_PROXY'] =  'http://10.10.10.10:8080'

 

mnist_train = dsets.MNIST(root='NIST_data/' ,train=True ,transform=transforms.ToTensor(),download=True)
mnist_test = dsets.MNIST(root='NIST_data/'  ,train=False,transform=transforms.ToTensor(),download=True)

 

소스를 수행하면 아래와 같이 다운로드 되는 것을 볼 수 있다. 

Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to MNIST_data/MNIST/raw/train-images-idx3-ubyte.gz

100%|█████████▉| 9904128/9912422 [00:42<00:00, 236106.08it/s]

Extracting NIST_data/MNIST/raw/train-images-idx3-ubyte.gz to MNIST_data/MNIST/raw

 

반응형

'Linux > Proxy' 카테고리의 다른 글

Proxy setting, date - Proxy가 있을 때 시간 동기화  (0) 2020.06.11
Proxy setting, npm (ubuntu 18.04)  (0) 2020.04.06
Proxy setting, conda (Windows)  (0) 2019.12.08
Proxy setting, pip (ubuntu)  (0) 2019.11.08
Proxy setting, conda (ubuntu 18.04)  (0) 2019.11.08

윈도우 환경에서도 conda에서 proxy 설정은 리눅스 환경과 똑같다.

다만 .condarc 파일의 생성 위치만 다르다.

 

 

1. conda configuration file 생성

아나콘다 설치 후 conda 환경에서 패키지들을 설치할 경우 proxy 설정이 필요할 때 다음과 같이 처리하면 

윈도우 사용자 디렉토리 아래에 .condarc 파일이 새로 생성된다.

윈도우 사용자 디렉토리 예 → C:\Users\Username

 

$ conda config --set ssl_verify false

 

2. configuration 설정

.condarc 파일을 열고 다음과 같이 기록한 후 저장한다.

ssl_verify: false

proxy_servers:

 http: http://proxy.server:port 

 https: http://proxy.server:port 

 

3. 주의사항

이때 proxy_servers: 아래의 http: 앞 부분 공백은 space를 이용해서 공백을 처리해야 한다.

tab 키를 이용해서 처리하면 안된다.

사용예)

ssl_verify: false

proxy_servers:

[space][space] http: http://20.30.40.10:8080

[space][space] https: http://20.30.40.10:8080

 

반응형

'Linux > Proxy' 카테고리의 다른 글

Proxy setting, npm (ubuntu 18.04)  (0) 2020.04.06
Proxy setting, jupyter notebook  (0) 2020.02.06
Proxy setting, pip (ubuntu)  (0) 2019.11.08
Proxy setting, conda (ubuntu 18.04)  (0) 2019.11.08
Proxy setting, docker (ubuntu 18.04)  (0) 2019.11.08

1. conda configuration file 생성

아나콘다 설치 후 conda 환경에서 패키지들을 설치할 경우 proxy 설정이 필요할 때 다음과 같이 처리하면 사용자 home directory 밑에 .condarc 파일이 새로 생성된다.

$ conda config --set ssl_verify false

 

2. configuration 설정

.condarc 파일을 열고 다음과 같이 기록한 후 저장한다.

ssl_verify: false

proxy_servers:

 http: http://proxy.server:port 

 https: http://proxy.server:port 

 

3. 주의사항

이때 proxy_servers: 아래의 http: 앞 부분 공백은 space를 이용해서 공백을 처리해야 한다.

tab 키를 이용해서 처리하면 안된다.

사용예)

ssl_verify: false

proxy_servers:

[space][space] http: http://20.30.40.10:8080

[space][space] https: http://20.30.40.10:8080

 

반응형

'Linux > Proxy' 카테고리의 다른 글

Proxy setting, jupyter notebook  (0) 2020.02.06
Proxy setting, conda (Windows)  (0) 2019.12.08
Proxy setting, pip (ubuntu)  (0) 2019.11.08
Proxy setting, docker (ubuntu 18.04)  (0) 2019.11.08
Proxy setting, apt-get (ubuntu 18.04)  (0) 2019.11.08

1. configuration directory 생성

$ sudo mkdir -p /etc/systemd/system/docker.service.d

 

2. configuration file 생성 및 환경 구성

$ sudo vi /etc/systemd/system/docker.service.d/proxy.conf

 

생성된 file에 아래와 같이 환경 구성을 기록하고 저장한다.

[Service]
Environment="HTTP_PROXY=http://proxy.server:port/"
Environment="HTTPS_PROXY=http://proxy.server:port/"
Environment="NO_PROXY="localhost,127.0.0.1,::1"

 

사용예)

[Service]
Environment="HTTP_PROXY=http://10.10.10.5:8080/"
Environment="HTTPS_PROXY=http://10.10.10.5:8080/"
Environment="NO_PROXY="localhost,127.0.0.1,::1"

 

3. daemon 재수행

$ sudo systemctl daemon-reload

 

4. docker service 재수행

$ sudo systemctl restart docker.service

 

반응형

'Linux > Proxy' 카테고리의 다른 글

Proxy setting, jupyter notebook  (0) 2020.02.06
Proxy setting, conda (Windows)  (0) 2019.12.08
Proxy setting, pip (ubuntu)  (0) 2019.11.08
Proxy setting, conda (ubuntu 18.04)  (0) 2019.11.08
Proxy setting, apt-get (ubuntu 18.04)  (0) 2019.11.08

 

§Proxy Server 개요
Proxy Server 정의
-보안 또는 캐시를 목적으로 사용자와 인터넷 사이에 중개자 역할을 하는 서버

 

Proxy Server 기능 

 

 

 

 

참고) Proxy Server 효용성 (Tip. "Proxy Server 기능" 대신 1-나에 사용가능)
-Performance  서비스 응답시간 보장
-Cost  보유 서비스에 대한 자원의 효율적 이용
-Availability  서비스 안정성 제공
-Security  악성코드 사전 확인 및 외부 직접 연계 방지

 

§Proxy Server 구성도 Cache 처리 방식
Proxy Server 구성도 

 

 

 

 

Cache 처리 방식 

 

 

 

 

 

§Proxy Server 전망 및 활성화 제언
대체 서비스 확산
-CDN, 서버형 L7 스위치 등 확산으로 입지 축소
보안 분야 적극 진출 및 인텔리전스 Proxy 모색 필요
-공공기관, 학교 등 에서 음란물 통제(인텔리전스)
-컨텐츠 사전 보안 체크 및 싱크홀 역할 등 수행, 돌파구 마련 필요

 

 

반응형

'Topic > 네트워크' 카테고리의 다른 글

Ad-Hoc Network  (0) 2014.09.11
IEEE 802.11n  (0) 2014.09.11
Wi-Fi direct  (0) 2014.09.10
SSL  (0) 2014.09.10
L7 Switch  (0) 2014.09.10

+ Recent posts