Editing config on Proxychains | Ubuntu for Windows Linux Sub System

6,589

locate command

Since the proxychains related files are newly added, they are not indexed yet. To update the locate index, enter:

sudo updatedb

Note: there is no dash between update and db. In general Ubuntu (Linux in general) is less forgiving than Windows when it command line. The commands are case sensitive.

The updatedb may take a bit of time. Once done, enter:

locate proxych

This will list all files with proxych in their name. The first one is:

/etc/proxychains.conf

This is the file you are looking for. Note: each path of file names start with /. This is the root of the Ubuntu file system. Don't confuse it with the root user. Think of this as C:\ in Windows. If you don't start with the initial / then Ubuntu will try to use the current directory.

An aside: On the other hand:

dpkg -L proxychains

Lists all the files folders installed and created by the package proxychains. Here you need to write the full name of the package, and it will list files even if its name does not include those letters such as copyright.

Editing configuration files in /etc

The correct command to edit /etc/proxychains.conf is:

sudo nano /etc/proxychains.conf

Note: the sudo in the front. This is because you want to edit an "editable text configuration" file. I don't recommend becoming root in Ubuntu. As a new user it is better to use a normal user bash shell and use sudo only when needed.

Second, note the aforementioned / in the beginning. If you enter etc/proxychains.conf without the / in the beginning nano will try to save the proxychains.conf file in a folder called etc inside your home folder. In otherwords it is the same as:

nano /home/$USER/etc/proxychains.conf

If you are the root account, it has a special location for the home folder /root. Thus, nano etc/proxychains.conf tries to edit

nano /root/etc/proxychains.conf

Since there is no etc folder inside your (or the root's) home folder, nano will not be able to save the file after you write or paste the text in it. Even if you create an etc folder inside your home folder and create a new configuration file there, it will be of no use to proxychains as it will look for the proxychains.conf in `/etc/ folder.

To uninstall and start from scratch

To uninstall proxychains but keep the configuration files use the command:

sudo apt remove proxychains

To To uninstall proxychains and the configuration files use the command:

sudo apt purge proxychains

This will get rid of proxychains.conf from /etc as well.

Some other things

cd .. && cd etc && cd privoxy && ls

This probably works because you are using a root shell and your current directory is /root. Once again this is not recommended. You should use your Ubuntu username and sudo with the password you created when you created your normal username. You can check your current directory by entering pwd in the command prompt.

This command is four commands separated by &&. The && tells bash to execute the next command once the previous one is done. You can get same results by:

ls /etc/privoxy

If you do want to change the directory cd /etc/privoxy will do the job rather than doing it in three commands and stringing them together. You can either use:

cd /etc/privoxy

and then

sudo nano config

or use &&:

cd /etc/privoxy && sudo nano config

or just type:

sudo nano /etc/privoxy/config

If your current location is /home/SweetDomination and you really like relative paths such as .. for the directory one level up then you can type:

sudo nano ../../etc/privoxy/config

you will be editing the same file. This is plain text file. You can enter all the lines by hand one letter at a time, or copy and paste it from somewhere else, or use the existing one and edit the changes you need. As long as you are creatng/ editing the file in the correct location and you don't make any syntax errors in the edits and writes, it does not matter if you manually write it or use the one that came with the installation (with edits if needed).

Hope this helps

Share:
6,589

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    Sorry if this is the wrong place to ask questions about the Windows Sub-System.

    To keep things brief, I am a rookie to bash and for convenience while learning, I installed Ubuntu for the Windows 10 Linux subsystem.

    The main issue here is: I cannot find the configuration file for proxychains.

    System Installation Notes:

    1. To Install the system, I opened an administrative power shell and ran:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

    1. After a quick reboot, I then installed the default Ubuntu bash by opening an administrative command prompt terminal and running:

    lxrun /install

    My Issue with Proxychains

    One of the facilities I wanted to play about with was proxychains. To install proxychains, I simply ran:

    sudo apt-get install proxychains
    

    and at the prompt, pressed Y.

    Now I wanted to, naturally, edit the /etc/proxychains.conf file and insert a custom proxychain. To do this I simply typed:

    locate proxychains
    

    This command showed no output, and merely returned me to root@desktop~#, blank, ready for me to insert another command. While simply typing:

    locate
    

    With no additional parameters returned the:

    locate: no pattern to search for specified
    

    After reading an article on How-To-Geek, I found another command to perform the same function:

    dpkg -L proxychains
    

    Which returned the output I had expected from the locate command:

    /.
    /etc
    /etc/proxychains.conf
    /usr
    /usr/bin
    /usr/bin/proxychains
    /usr/share
    /usr/share/doc
    /usr/share/doc/proxychains
    /usr/share/doc/proxychains/AUTHORS
    /usr/share/doc/proxychains/copyright
    /usr/share/doc/proxychains/TODO
    /usr/share/doc/proxychains/README.Debian
    /usr/share/doc/proxychains/README
    /usr/share/man
    /usr/share/man/man1
    /usr/share/man/man1/proxychains.1.gz
    /usr/share/doc/proxychains/changelog.Debian.gz
    

    I then ran the following command after a quick cd && cd.. to ensure I was in the right place.

    cd etc 
    

    A quick scroll through the files listed here showed no proxychains.conf file. when running:

    nano proxychains.conf
    

    It simply created a blank file as expected.

    nano etc/proxychains.conf
    

    Running straight from a new terminal outputs the same blank file.

    Trying to configure a different package (Privoxy)

    To see if it was simply an issue with proxychains, I ran the following:

    sudo apt-get install privoxy
    

    Again the command locate privoxy returned me to root@desktop~# ready for another command, so I ran:

    dpkg -L privoxy
    

    And received the expected output:

    /etc/privoxy/templates/edit-actions-list-button
    /etc/privoxy/templates/edit-actions-url-form
    /etc/privoxy/templates/cgi-error-file
    /etc/privoxy/templates/cgi-error-parse
    /etc/privoxy/templates/no-such-domain
    /etc/privoxy/templates/connection-timeout
    /etc/privoxy/templates/show-status-file
    /etc/privoxy/templates/blocked
    /etc/privoxy/templates/edit-actions-list-url
    /etc/privoxy/templates/toggle-mini
    /etc/privoxy/templates/toggle
    /etc/privoxy/templates/show-version
    /etc/privoxy/templates/edit-actions-list
    /etc/privoxy/templates/cgi-error-modified
    /etc/privoxy/templates/edit-actions-list-section
    /etc/privoxy/templates/connect-failed
    /etc/privoxy/templates/show-request
    /etc/privoxy/templates/forwarding-failed
    /etc/privoxy/templates/cgi-error-file-read-only
    /etc/privoxy/templates/cgi-style.css
    /etc/privoxy/templates/mod-local-help
    /etc/privoxy/templates/mod-unstable-warning
    /etc/privoxy/default.action
    /etc/privoxy/config
    /etc/privoxy/user.action
    /etc/logrotate.d
    /etc/logrotate.d/privoxy
    /etc/init.d
    /etc/init.d/privoxy
    

    Both while using:

    nano etc/privoxy/config
    

    and:

    cd .. && cd etc && cd privoxy && ls
    nano config
    

    I got the expected example set up document.

    I uninstalled and reinstalled proxychains several times, and made sure the cd && cd.. && cd etc/ directory was cleared each time. Every single time the same error was encountered when trying to edit the default file.

    Troubleshooting "Locate"

    When trying to fix the "locate" command error I ran:

    sudo update-db
    

    And received the following error:

    bash: update-db: command not found
    

    Conclusion

    Any advice on how to beat this problem would be appreciated.

    I would like to know if creating a manual version of the standard proxychains.conf file in cd && cd.. && cd etc would work?

    • Panther
      Panther about 6 years
      You have 2 problems. First locate works on a data base after installing new packages, so run sudo updatedb then locate privoxy or what not. Second read about path. etc/privoxy/config is not the same as /etc/privoxy/config . Other than that you can write from scratch or copy paste, but be sure you read the config and leave comments (comments start with a #).
  • Admin
    Admin about 6 years
    @user68186 Thank you indeed, worked perfectly, and I'm grateful for the tips on how to use bash. Copying a given command precisely is always something I try and do, and I apologise for the messy job this time round. Much obliged to you all for helping me see my error.