Score:0

How do I use a proxy which contains a user and password?

cn flag

I wanted to set a proxy on my machine, However, the network proxy option in settings doesn't have a user:pass field, which is required to get my SOCK5 proxy working. This is my first time using Linux so I'm not very thorough with the terminal.

Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:    21.10
Codename:   impish 
PixelatedXenon avatar
cn flag
What do you mean?
PixelatedXenon avatar
cn flag
It's for one username
cn flag
OK. Decided to add both ;-) see if the answer works for you
Score:1
cn flag

If you want to set this for all users on the system edit

sudo nano /etc/environment

and add

export HTTP_PROXY="{user}:{pwd}@{proxy--address}:{port}"
export HTTPS_PROXY="{user}:{pwd}@{proxy--address}:{port}"
export FTP_PROXY"{user}:{pwd}@{proxy--address}:{port}"
export NO_PROXY="localhost,127.0.0.1,::1"

If you want it for a single user you can put those lines in

sudo nano ~/.bashrc

That method allows for a different proxy for each user. If you need a proxy for apt:

sudo nano /etc/apt/apt.conf

and add

Acquire::http::Proxy "http://{user}:{pwd}@ {proxy-address}:{port}";
Acquire::https::Proxy "http://{user}:{pwd}@ {proxy-address}:{port}";
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.