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

October 2016

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

Related :

This document entitled « Configure a proxy on Debian or Ubuntu with @ in the user login or password » from CCM ( is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.