Results 1 to 10 of 10

Thread: remove proxy via terminal

  1. #1
    Join Date
    Oct 2012
    Beans
    5

    remove proxy via terminal

    Hi all

    I have a ubuntu box and I installed privoxy to use my machine as a proxy to test websites from different regions.

    Decided against this and removed via purge but remembered the global proxy settings are still set.

    Problem: I am SSHed into the box as i am not near the box and I need to install some things but cant as its looking at localhost (via proxy)

    I have tried the following

    export http_proxy=""

    removing the lines in
    /etc/environment

    and finally
    gsettings set org.gnome.system.proxy.mode 'none'

    I get the following error on the last line

    WARNING **: Command line `dbus-launch --autolaunch=e1614808267a12940aef87360000000e --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n


    Still looking at localhost
    How do I remove the damn proxy via terminal

  2. #2
    Join Date
    Mar 2010
    Location
    Dublin, Ireland
    Beans
    Hidden!
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: remove proxy via terminal

    Hi and welcome to the forums,

    I presume that you have a GUI running on the box, but you're using an ssh terminal to access it?

    If so, you could try the following before running gsettings:

    Code:
    sessionfile=`find "${HOME}/.dbus/session-bus/" -type f`
    export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'`
    Then try:

    Code:
    gsettings set org.gnome.system.proxy.mode 'none'
    again.
    Matt
    blog.mattrudge.net for extra helpings of geeky Ubuntu goodness
    Get the Ubuntu Weekly Newsletter

  3. #3
    Join Date
    Oct 2012
    Beans
    5

    Re: remove proxy via terminal

    Cheers

    DOne and I get the following error

    webserver@Jamie-WebServer:~$ sessionfile=`find "${HOME}/.dbus/session-bus/" -type f export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'


    find: paths must precede expression: export
    Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
    DBUS_SESSION_BUS_ADDRESS: command not found

  4. #4
    Join Date
    Mar 2010
    Location
    Dublin, Ireland
    Beans
    Hidden!
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: remove proxy via terminal

    Sorry, I should have made it clear that those are two lines of code.

    So, firstly:

    Code:
    sessionfile=`find "${HOME}/.dbus/session-bus/" -type f`
    Then:

    Code:
    export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'`
    Make sure to include the backquote ` at the end of each line as well
    Matt
    blog.mattrudge.net for extra helpings of geeky Ubuntu goodness
    Get the Ubuntu Weekly Newsletter

  5. #5
    Join Date
    Oct 2012
    Beans
    5

    Re: remove proxy via terminal

    Got the following

    gsettings set org.gnome.system.proxy mode 'none'

    ** (process:2586): WARNING **: Could not connect: Connection refused

    ** (process:2586): WARNING **: Could not connect: Connection refused

  6. #6
    Join Date
    Mar 2010
    Location
    Dublin, Ireland
    Beans
    Hidden!
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: remove proxy via terminal

    Ok, if you're accessing from an Ubuntu machine, then try this instead. On the remote machine, type:

    Code:
    nano ~/proxychange.sh
    In the new file, paste the following:

    Code:
    #!/bin/bash
    
    sessionfile=`find "${HOME}/.dbus/session-bus/" -type f`
    
    export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'`
    
    gsettings set org.gnome.system.proxy.mode 'none'
    Close and save the file. Then:

    Code:
    chmod +x ~/proxychange.sh
    Now disconnect your ssh session and, from your local Ubuntu machine, issue the command:

    Code:
    ssh -X username@ip-address ~/proxychange.sh
    This will attach your remote machine to a local X server and run the command. Hopefully that will change the proxy settings for you.
    Matt
    blog.mattrudge.net for extra helpings of geeky Ubuntu goodness
    Get the Ubuntu Weekly Newsletter

  7. #7
    Join Date
    Oct 2012
    Beans
    5

    Re: remove proxy via terminal

    No, im using windows with putty.

    Dont worry, something else has come up, so I will be home by the time I can look at my box again, so then I can go via the gui not SSH Terminal

    Thanks for your help tho

  8. #8
    Join Date
    Oct 2012
    Beans
    5

    Re: remove proxy via terminal

    Got home, logged straight onto the box itself. Settings ->proxy ->none.

    All working now

    Cheers for your help tho lechien73

  9. #9
    Join Date
    Oct 2012
    Beans
    1

    Re: remove proxy via terminal

    The configuration information is saved under .gconf (front end GconfEdior), which is a system for storing application preference in Gnome (think Registry for Windows PC).

  10. #10
    Join Date
    Feb 2006
    Location
    San Antonio
    Beans
    347
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: remove proxy via terminal

    Hello,
    Glad to hear you solved it.
    I believe the command is:
    Code:
    export http_proxy=none
    Josh Beck
    Northeast Independent School District
    KSAT (Krueger School of Applied Technologies)
    http://linuxclassroom.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •