Configure a proxy on Debian or Ubuntu with @ in the user login or password

Ask a question

When using a freshly installed Debian, users willing to connect to a proxy to surf the net (commonly used by professionals in a business environment) are confronted by two concerns related both to one thing: the @ sign is interpreted by the terminal as as a separator and not as part of the login or password. Some companies make use of logins in the following format "" and it is therefore important for the system to consider the @ sign as part of the login. If your password contains an @, the sign will be interpreted as a separator and your password will be truncated.

Here are the solutions:
  • In all cases, the command lines must be entered in the terminal:
  • If you have permission errors, switch to root
    • su root
  • or
    • sudo

In the case of a normal proxy where authentication can be done with a short name (for example, domain\user)
the syntax is:
export http_proxy=http://[DOMAIN\]USERNAME:PASSWORD@SERVER:PORT        

When the login has the @ symbol:
  • replace the @ sign with \@

export http_proxy=http://EMAIL\@DOMAIN.COM:PASSWORD@SERVER:PORT        
export ftp_proxy=http://EMAIL\@DOMAIN.COM:PASSWORD@SERVER:PORT  

When the password has the @ symbol:
  • replace the @ sign with replace the @ sign with \@

 export http_proxy=[http://][DOMAIN\]USERNAME:P%40SSWORD@SERVER:PORT         
 export ftp_proxy=[http://][DOMAIN\]USERNAME:P%40SSWORD@SERVER:PORT

Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team