#language en ##~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: none-~ ##---- SOCKS is an Internet protocol that facilitates the routing of network packets between client–server applications via a proxy server. SOCKS performs at Layer 5 of the OSI model—the session layer (an intermediate layer between the presentation layer and the transport layer). Port 1080 is the registered port designated for the SOCKS server. The SOCKS5 protocol was originally a security protocol that made firewalls and other security products easier to administer. (source: Wikipedia: WikiPedia:SOCKS) ## If your page gets really long, uncomment this Table of Contents ## <> == SOCKS servers == Debian provides some SOCKS5 compatible server... search SOCKS in your prefered packages manager, like: {{{apt-cache search SOCKS}}} At the time of writting, DebianTesting has: * DebianPkg:hpsockd - HP SOCKS server (last updated 2008) * DebianPkg:dante-server - SOCKS (v4 and v5) proxy daemon (danted) * DebianPkg:shadowsocks - Fast tunnel proxy that helps you bypass firewalls * DebianPkg:socks4-server - SOCKS4 server for proxying IP-based services over a firewall (orphaned) Also, many people uses openssh to act as a SOCKS5 server, see http://www.debian-administration.org/article/SSH_dynamic_port_forwarding_with_SOCKS == SOCKS clients == Some applications can be instructed to use the SOCKS proxy in various ways: * Gnome compatible applications should use the system settings (in {{{Menu >> System >> Preferences >> Network Proxy}}}). ''KDE may have similar setting''. * Some applications can be explicitely configured to use a SOCKS server, like DebianPkg:iceweasel web browser, DebianPkg:filezilla FTP client, DebianPkg:putty SSH client, DebianPkg:sim Instant messaging, etc. * Most applications can use some kind of helper, which encapsulate/proxy the application's connection(s) through the specified server (more below) == SOCKS helpers & wrappers == Some helpers: * DebianPkg:connect-proxy - Establish TCP connection using SOCKS4/5 or HTTP tunnel * DebianPkg:socat - multipurpose relay for bidirectional data transfer * DebianPkg:tsocks - transparent network access through a SOCKS 4 or 5 proxy * DebianPkg:proxychains - proxy chains - redirect connections through proxy servers * DebianPkg:dante-client - SOCKS wrapper for users behind a firewall * DebianPkg:redsocks - Redirect any TCP connection to a SOCKS or HTTPS proxy server (If you wonder which one is the most poular, check: [[http://qa.debian.org/popcon-graph.php?packages=connect-proxy,tsocks,proxychains,dante-client,socat,redsocks&show_vote=on&want_legend=on&want_ticks=on&beenhere=1|popcon]] ) === tsocks === See http://www.debian-administration.org/article/SSH_dynamic_port_forwarding_with_SOCKS == Application specific instructions == === Using SSH client === (If your gateway doesn't have a SOCKS helper, there are some alternatives, using netcat http://benno.id.au/blog/2006/06/08/ssh_proxy_command , or even this one [which doesn't work in Debian because of DebianBug:146464] http://www.rschulz.eu/2008/09/ssh-proxycommand-without-netcat.html ) [[#tsocks|tsocks]] can be used too. ==== SSH and connect-proxy ==== Assuming your SOCKS server is running on your localhost, listening on port 20000, you could run one of the following commands: 1. {{{ssh root@mysshserver -o ProxyCommand='connect-proxy -S localhost:20000 %h %p'}}} 2. Configure your {{{~/.ssh/config}}}: {{{ host mysshserver User root ProxyCommand connect-proxy -S localhost:20000 %h %p }}} then simply run: {{{ssh mysshserver}}} 3. Define an environement variable and an alias in {{{~/.bashrc}}} : {{{ export SOCKS5_SERVER=localhost:20000 alias ssh_socks="ssh -o ProxyCommand='connect-proxy -s %h %p'" }}} which makes it easy to ssh through your SOCKS proxy __when__ you need it, by simply running: {{{ssh_socks root@mysshserver}}} ## Alternatives, not packaged in Debian: ## http://bent.latency.net/bent/git/goto-san-connect-1.85/src/connect.html ## You can add other _helpful_ links here. == See also == * http://en.wikipedia.org/wiki/SOCKS * DebianPkg:torsocks - use socks-friendly applications with Tor * DebianPkg:corkscrew - tunnel TCP connections through HTTP proxies ---- ## If this page belongs to an existing Category, add it below. ## CategorySomething | CategoryAnother