Инструменты пользователя

Инструменты сайта


 ↔

Боковая панель

linux:proxy_via_ssh_connect
Эта версия (2018/08/01 16:18) была проверена пользователем Случайный зритель.Доступна предыдущая проверенная версия (2016/12/01 13:58).Diff

Proxy via ssh in Firefox

about:config
network.proxy.socks_remote_dns <- yes
ssh -D 9999 -C dm@MYIP -pPORT

Настройки - Дополнительно - Сеть

ip route get 66.6.42.21
66.6.42.21 via 10.100.0.1 dev eth0  src 10.100.1.66 
    cache 
    
ip route get 66.6.41.30
66.6.41.30 via 10.100.0.1 dev eth0  src 10.100.1.66 
    cache

без прокси

curl ipecho.net/plain ; echo
5.101.159.150

curl -I -v --socks5 localhost:9999 http://www.google.ru
* Rebuilt URL to: http://www.google.ru/
*   Trying ::1...
* connect to ::1 port 9999 failed: В соединении отказано
*   Trying 127.0.0.1...
* connect to 127.0.0.1 port 9999 failed: В соединении отказано
* Failed to connect to localhost port 9999: В соединении отказано
* Closing connection 0
curl: (7) Failed to connect to localhost port 9999: В соединении отказано


с прокси

curl --socks5 localhost:9999 http://ipecho.net/plain ; echo 
MYIP

curl -I -v --socks5 localhost:9999 http://www.google.ru
* Rebuilt URL to: http://www.google.ru/
*   Trying ::1...
* 87
* 245
* 198
* 50
* Connected to localhost (::1) port 9999 (#0)
> HEAD / HTTP/1.1
> Host: www.google.ru
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Fri, 01 Jul 2016 09:10:30 GMT
Date: Fri, 01 Jul 2016 09:10:30 GMT
< Expires: -1
Expires: -1
< Cache-Control: private, max-age=0
Cache-Control: private, max-age=0
< Content-Type: text/html; charset=windows-1251
Content-Type: text/html; charset=windows-1251
< P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
< Server: gws
Server: gws
< X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
< Set-Cookie: NID=81=lQrCw6mwpYInad-; expires=Sat, 31-Dec-2016 09:10:30 GMT; path=/; domain=.google.ru; HttpOnly
Set-Cookie: NID=81=lQrCw6mwpYInad-; expires=Sat, 31-Dec-2016 09:10:30 GMT; path=/; domain=.google.ru; HttpOnly
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Accept-Ranges: none
Accept-Ranges: none
< Vary: Accept-Encoding
Vary: Accept-Encoding

< 
* Connection #0 to host www.google.ru left intact

 
ping -c 10 66.6.42.21
PING 66.6.42.21 (66.6.42.21) 56(84) bytes of data.
 
--- 66.6.42.21 ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 9072ms

ping -c 10 66.6.41.30
PING 66.6.41.30 (66.6.41.30) 56(84) bytes of data.
64 bytes from 66.6.41.30: icmp_seq=1 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=2 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=3 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=4 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=5 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=6 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=7 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=8 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=9 ttl=50 time=119 ms
64 bytes from 66.6.41.30: icmp_seq=10 ttl=50 time=119 ms

--- 66.6.41.30 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9011ms
rtt min/avg/max/mdev = 119.210/119.374/119.588/0.245 ms

Обсуждение

Случайный зритель, 2018/08/01 16:17
ssh -o 'IdentitiesOnly=yes' pi@MYIP -pPORT
Случайный зритель, 2017/09/25 20:12, 2018/08/01 16:17
ssh -C2qTnN -D 9999 -o 'IdentitiesOnly=yes' pi@MYIP -pPORT
Галочкин Дмитрий, 2017/01/23 17:19, 2018/08/01 16:17
chromium-browser --proxy-server="socks5://localhost:9999"
Галочкин Дмитрий, 2016/07/07 11:53, 2018/08/01 16:18

Проверить

ssh -D 8080 -f -C -q -N myuser@remote_ssh_server

-D 8080 : This does the dynamic stuff and makes it behave as a SOCKS server.
-f : This will fork the process into the background after you type your password.
-C : Turns on compression.
-q : Quiet mode. Since this is just a tunnel we can make it quiet.
-N : Tells it no commands will be sent. (the -f will complain if we don’t specify this)

-2      Forces ssh to try protocol version 2 only.
-T      Disable pseudo-terminal allocation.

-n      Redirects stdin from /dev/null (actually, prevents reading from stdin). 
This must be used when ssh is run in the background. A common trick is to use
this to run X11 programs on a remote machine.  For example, ssh -n 
shadows.cs.hut.fi emacs & will start an emacs on shadows.cs.hut.fi,
and the X11 connection will be automatically forwarded over an
encrypted channel. The ssh program will be put in the
background. (This does not work if ssh needs to ask 
for a password or passphrase; see also the -f 
option.)
ssh -D 9999 -f -C -q -N -2 -T -n dm@MYIP -pPORT
Галочкин Дмитрий, 2016/07/06 11:46, 2016/07/06 11:46

firefox about:config

network.http.max-persistent-connections-per-proxy 25

network.http.max-connections                        25
network.http.max-connections-per-server             25
network.http.max-persistent-connections-per-proxy   25
network.http.max-persistent-connections-per-server  25

network.http.pipelining              true
network.http.pipelining.maxrequests  8
network.http.pipelining.ssl          true
network.http.proxy.pipelining        true
Ваш комментарий. Вики-синтаксис разрешён:
M W Y Q P
 
/home/d/dgaloc/wiki.dmgl.info/public_html/data/pages/linux/proxy_via_ssh_connect.txt · Последние изменения: 2018/08/01 16:16 — Случайный зритель