I'm using ssh -D to create a socket proxy and want to know how to use pip(or easy_install) with it? I find this question but that's an http proxy.
Also, please give me a solution works under OS X. (I tried proxifier, it works with pip install, but not sudo pip install)
Easiest method, also works on many OS's:
pip install pysocks
pip install <yourpacakge> --proxy socks5:127.0.0.1:8123
Substitute socks4, and your own ip/port as needed.
Use socks proxifier, for example proxychains.
Command pip will be like proxychains pip install package_name.
Or use another proxifier.
For CentOS, you can use privoxy to convert socks5 proxy to http proxy.
yum install privoxy
Then edit /etc/privoxy/config, at the end of the file, add:
forward-socks5 / 127.0.0.1:1080 .
It will convert socks5 proxy from 1080 to http proxy 8118. Then you can specify the proxy in your pip config file:
[global]
proxy = 127.0.0.1:8118
DO NOT use polipo, as it is already deprecated.
As other users have posted the following works well for using pip via a remote host:
# SOCKS4 proxy creation
ssh -D9999 <remote host URI>
# use pip with the previously created proxy connection (requires pysocks)
python3 -m pip install <package name> --proxy socks5:localhost:9999
Bootstrapping
"But I need pysocks to run pip through a proxy and you can't connect to the pypi to download packages as I don't have functioning pip"
One way to get around this is to download the pysocks wheel package on another machine:
python3 -m pip download pysocks
This will download the pysocks package to your machine. Transfer the PySocks-x-x-x-py3-none-any.whl file to the machine that requires proxy functionality and install:
python3 -m pip install PySocks*.whl
Nevermind, --proxy seems to work with http(s) proxy only.
From "pip --help"
--proxy <proxy> Specify a proxy in the form
[user:passwd#]proxy.server:port.
Edit: I finally gave up sock proxy and run a java http proxy (jhttp2.sourceforge.net/) on my remote machine and use ssh -L port:localhost:port to forward the port to the remote machine and use that http proxy.
Run these two commands:
pip install pysocks5
pip install --proxy socks5://[user:passwd#]proxy.server:port something
first of all you can try install proxychains-ng using
brew install proxychains-ng
the can try make a socks5 proxy using ssh -D like
ssh -D 12345 -fqN root#[your-vps-ip]
and use public-key or password to access your vps
then you have both proxychain and socks5.
Now edit /etc/proxychains.conf , simply add this line at the end of it
socks5 127.0.0.1 12345
and comment this
socks4 127.0.0.1 9050
Finally
proxychains4 pip install [whateveryouwant]
On Windows (mine was Win2012R2) I managed connecting through SOCKS5-proxy by doing those steps:
All-user-level-pip:
Adding this lines to pip.ini under "C:\ProgramData\pip":
[global]
proxy = socks5:{proxy-ip}:{proxy-port}
Opening cmd.exe (maybe but not necessarily as administrator ... depends on your file-system configuration...)
Setting proxy variables to "no-proxy" explicitly!!! ... like that:
set http_proxy=no-proxy
set https_proxy=no-proxy
running for example pip install your_module and finally it works through the socks5-proxy specified in the pip.ini
For user-level-pip you need to place the pip.ini somewhere else according pip-documentation.
Related
I am unable to install proxychains on a remote system because the system only has outbound access to port 22/tcp to my server. However, I can use ssh -D 9050 root#myip to listen on port 9050 for socks proxy.
That being said, how can I run apt update and apt install proxychains through socks port 9050 so that I can install proxychains and use it for future commands?
I've tried to run:
export http_proxy=socks5://127.0.0.1:9050 https_proxy=socks5://127.0.0.1:9050
but as soon as I ran apt update, the outbound connection fails. Not sure if this is the correct way to do it or if I'm just missing something small.
One solution I was able to use is by downloading the ZIP version of https://github.com/rofl0r/proxychains-ng, SCP'ing it over to the remote server, and then compiling it locally on that system.
Afterwards, I'm able to use ./proxychains4g -f src/proxychains.conf <command> and so now it looks like I'm good to go.
When I use the shadowsock's client on windows, and I make it the global agent.
Then, whatever I use Fixfox or chrome, I could get the result I want.
I want to know , how the client make the other software use the Internet through it ? Could someone tell the knowledge about this?
on unix system, using proxychains
intall proxychains
ubuntu
sudo apt-get install proxychains
mac os x
brew install proxychains
from source code
Edit proxychains config
add below line to /etc/proxychains.conf on linux or ~/.proxychains/proxychains.conf on mac
socks5 127.0.0.1 1080 # on linux
socks5 127.0.0.1 1086 # on mac
Don't forget remove remove socks4 if exits
Usage
on linux
proxychains wget https://www.google.com
proxychains google-chrome
on mac
proxychains4 wget https://www.google.com
I am trying to install GitLab on a subdomain. I am not very familiar with web servers and stuff, only very little knowledge. I am currently connected to the subdomain via ssh admin#mysite.com on the Mac's Terminal. Then I ls to the subdomain's folder. Question is if I execute:
curl -O https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm
sudo yum install openssh-server
sudo yum install postfix
sudo yum install cronie
sudo service postfix start
sudo chkconfig postfix on
sudo rpm -i gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm
on the current folder. Will GitLab be installed or downloaded only in the current folder or will other subdomains and folders of the site be affected?
Is there a way to test yum install first on the current directory?
The Omnibus/RPM version of Gitlab will install gitlab to the /opt/gitlab directory.
If you want to check the files that will be installed by an RPM package you can do so with:
rpm -qlp gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm
After you install the RPM with "rpm -ivh gitlab*.rpm" you configure the URL/subdomain using the:
/etc/gitlab/gitlab.rb
file.
After amending the gitlab.rb file you can start gitlab with:
gitlab-ctl start
Or restart it with:
gitlab-ctl restart
You can configure the web address & port that gitlab/nginx listens on using the external_url parameter in the gitlab.rb file:
external_url "https://gitlab.mydomain.com"
If you already have a webserver (such as Apache) using port 80 or port 443 then you might want to ask gitlab/nginx to listen on a port other than 80 or 443 with:
external_url "https://gitlab.mydomain.com:8443"
You can check if anything is listening on particular ports using:
netstat -luntap | grep LISTEN
I am using a a devpi-server to locally cache and install pypi packages using pip. However when I search for packages using the devpi server I get the following error:
pypi.xyz.com is the name of the server
ProtocolError: <ProtocolError for pypi.xyz.com:33141/root/pypi/+simple/: 405 Method Not Allowed>
Note that install work just fine
Edit: I am using a proxy that is allowed to access pypi.xyz.com by setting http_proxy before calling the pip command. The proxy is working fine and allows access to the pypi.xyz.com server as you can run the pip install commands without any trouble.
pip.conf:
[global]
[install]
index-url = http://pypi.xyz.com:33141/root/pypi/+simple/
[search]
index = http://pypi.xyz.com:33141/root/pypi/+simple/
Adding the clarifications requested by #JanVlcinsky:
1. Installed devpi using pypi
2. None of the default settings were modified except the port change
3. Protocol Error is in the console when I use pip with the following environment variable set
export http_proxy=http://localhost:33128
Changed port to 33141 Just for some obfuscation security, try to avoid using defaults
It is an http_proxy (running locally using squid)
You can find the answer in the "using pip search" section of the official doc:
pip install -q -U devpi-web
devpi-server --stop
devpi-server --recreate-search-index
devpi-server --start
I have an Ubuntu workstation and i'm trying to bootstrap a windows node. The windows node has ssh open on port 2222. I've been following http://docs.opscode.com/plugin_knife_windows.html.
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo gem install knife-windows --http-proxy=[REMOVED]
Successfully installed knife-windows-0.5.12
1 gem installed
Installing ri documentation for knife-windows-0.5.12...
Installing RDoc documentation for knife-windows-0.5.12...
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo knife bootstrap windows ssh 10.29.3.114 -x chef -P SSHuser1! -N test -p 2222 -VV
DEBUG: Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
DEBUG: Found bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Bootstrapping Chef on windows
DEBUG: Adding windows
DEBUG: establishing connection to windows:2222
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings
To me what that looks like is it's trying to use the word windows as part of the IP; however my syntax matches the guide so i don't know why. Does anyone have any ideas on how to fix this?
If you look at the output it's running the generic bootstrap template.
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Most likely there is an installation or ruby environment issue resolving the knife-windows gem.
When correctly configured you should see:
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-windows-0.5.12/lib/chef/knife/bootstrap
The only fix I have found is to use knife from a windows workstation instead of a linux one.
knife bootstrap windows winrm 111.22.33.44.compute-1.amazonaws.com -x Administrator -P "asdklfj329" -N "windows-2008-551"
Enjoy :)
I have faced the similar issue.One of the reasons for this might be you knife-windows gem package is not installed in expected location.
knife-windows resolves target hostname ,if its not properly installed winrm knife cant resolve targetname.So to overcome this install knife-windows as below
To install the knife windows plugin using RubyGems, run the following command:
$ /opt/chef/embedded/bin/gem install knife-windows
if properly installed you should be able to find knife-windows at
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/