Vagrant proxy through CNTLM on Windows using CYGWIN

Wow, talk about a crappy post title, but I just got this working on my corporate network and was quite happy about it.
Reason for this post; Every time I start a new assignment at a (rather big) corporation, I need to follow these steps to be able to access the internet from my vm’s.
(and I keep forgetting the steps, I’m getting old..)
What we’ll use to get this working:

  • Cygwin : https://www.cygwin.com/
  • Vagrant : https://www.vagrantup.com/
  • Virtualbox : https://www.virtualbox.org/
  • Cntlm : http://cntlm.sourceforge.net/

I’m running CentOS vm’s inside Vagrant with Virtualbox provisioning on Cygwin on Windows 7. I’m running Cntlm to create a local proxy for all stuff what I’m doing through cygwin, because I don’t like putting clear text passwords in bashrc or in Win / Bash variables.

Steps:

  1. Get your corporate proxy URL (Via Google Chrome)
  2. Configure Cntlm
  3. Configure Cygwin
  4. Configure Vagrant
  5. Use teh interwebs from your VM, practicing ninja turtle coding skillz and be instantly awesome!!1!

Continue reading “Vagrant proxy through CNTLM on Windows using CYGWIN”

Create a simple HTTPS server with OPENSSL S_SERVER

This post will mostly serve as a reference for future posts, the goal is to create the simplest HTTPS webserver possible, which will serve to test certificates, authentication via private keys and in the end; configure SSL offloading to an Apache HTTPD, which will act as a proxy between your client and the secure endpoint.
GOAL: At the end of this article, you will have a running secure web server which you can access via your web browser and/or via an SSL client. Continue reading “Create a simple HTTPS server with OPENSSL S_SERVER”

SSH through a proxy to a remote server

I wanted to SSH into my home server from my workplace but I couldn’t reach it directly because of the way the network was set up.
As it turns out it is quite easy to do by using the corkscrew program.
Edit ~/.ssh/config and add the following lines:

Host home joris.his.homeserver.com
    Hostname joris.his.homeserver.com
    User joris
    ProxyCommand corkscrew proxyserveraddress proxyserverport %h %p

The most important part is the ProxyCommand, this lets your ssh client know that it should use corkscrew as a proxy to your host. %h means the host of your remote server, %p means the port of your remote server.

Proxy authentication in Ubuntu 11.10 Oneiric Ocelot (Update)

This post simplifies the way to set your proxy which was explained in my previous post on October 21st.
(From the original post): Since Ubuntu 11.10, the proxy settings tab in the system settings have been changed, it’s no longer possible to enter your credentials in the proxy settings.
Before you start, you’ll need to find these values:

  • Proxy host
  • Proxy port
  • Proxy user name (would normally be your personal user name)
  • Proxy user password (would normally be your personal password)

Open a terminal and use the following commands to set these values, each line represents one command (! Adjust the values to your values !)

gsettings set org.gnome.system.proxy use-same-proxy 'true'
gsettings set org.gnome.system.proxy.http authentication-password 'ReplaceWithYourPassword'
gsettings set org.gnome.system.proxy.http authentication-user 'ReplaceWithYourUsername'
gsettings set org.gnome.system.proxy.http host 'ReplaceWithYourProxyHost'
gsettings set org.gnome.system.proxy.http port 'ReplaceWithYourProxyPort'
gsettings set org.gnome.system.proxy.http use-authentication 'true'
gsettings set org.gnome.system.proxy.http enabled 'true'

This should give you access through your company proxy! Happy browsing!
Ps. When you’re at home and you want disable the use of a proxy, use this command:

gsettings set org.gnome.system.proxy.http enabled 'false'

Ubuntu terminal doesn't unset proxy

Last week I’ve brought my own laptop to work and setting up evolution, subversion, the alsb and bpm environments with their proper endpoints and last but not least, I’ve set my Ubuntu Network Proxy to my companies proxy settings.
When I’ve returned home, I found out that the proxy settings were still active. One might imagine that would purge the settings in the Network Proxy to “Direct Internet Connection” but unfortunately, it did not.
Apparently there are three proxy settings which are left being set when using the terminal:

  • http_proxy
  • https_proxy
  • ftp_proxy
Apt-get, wget and all the CLI programs which use internet would fail because they’re searching for this proxy setting, but it isn’t to be found since we’re not at our company 🙂
A temporary solution is to unset these proxy settings, copy and paste each of these commands in your terminal and press enter:
unset http_proxy
unset https_proxy
unset ftp_proxy

I’ll add a permanent solution when I find it. For now this will clear the proxy settings within your terminal and you’ll be able to update and upgrade your repos through the terminal again!
Ps. I’m still looking for a nice dhcp client script which would add dns search domains to my /etc/resolv.conf, if you might know one; keep me posted!