# Socks5

## MarkYork

I'm working on a business project to implement GNU/Linux as the main OS on a business unit in Argentina.

We connect to the client's network over SOCKS5 and I'm trying to sort out what is the best SOCKS client for my needs. I've been experimenting with tsock, which has worked out very well, but it has 1 main drop back, which is the luck of an ID prompt. I have no problems setting the user ID and password on the tsocks.conf file, but this will be shared machines and it's not a possibility to share the SOCKS ID.

Do you guys know a socks client that will prompt for a user ID and password instead of saving it to the main conf file?

----------

## Hu

What about if you patch tsock to read a configuration file that is per-user, rather than per-machine?  This would enable you to have private SOCKS IDs specified in configuration files in user home directories.

----------

## MarkYork

Sounds like a good alternative. But... I wouldn't know how to patch tsocks to perform such a task. What do you mean with patch it? you mean to add some lines to the code so that it reads the config from $HOME?

----------

## Hu

Yes.

----------

## MarkYork

Ok, and how would you do it?

----------

## miket

 *MarkMan wrote:*   

> Ok, and how would you do it?

 

I wanted that too.  While I can't say that I've any great success so far in making tsocks work (I'm searching for a solution for that), I have figured out the configuration-file problem:  set the TSOCKS_CONF_FILE environment variable to the name of the configuration file.  Here's an example:

```
TSOCKS_CONF_FILE=my_tsocks.conf tsocks midori
```

I figured this out by examining the tsocks source code.  I thought I was going to need to patch the code if I couldn't find an some undocumented hook.  I found that undocumented hook, so I didn't bother modifying the code.

I still couldn't make tsocks work for me, but in my looking through the source I find another environment variable,  TSOCKS_DEBUG, which sets the debug level.  It was by examining the debug output that I found that tsocks indeed did pick up the configuration from the file I specified by TSOCKS_CONF_FILE.

Now if I can only get the thing to work...

----------

## toralf

You can set socks user + socks password with environment variables too. For my purpose I set them into a file, that I source it with 

```
". $HOME/foo" 
```

just before I call something like 

```
tsocks ssh ...
```

----------

