Search code examples
bashsshscp

Scp with @ and : in username


I would like to know how can i use SCP with username like that :

coucou@kiki:SSH:myname

I'm trying with something like that:

scp "coucou@kiki:SSH:myname@11.1.1:/var/log/apache /var/log1"

but I get the following error :

ssh: Could not resolve hostname kiki: Name or service not known

Solution

  • I found that escaping the @ in the username using SSH worked, but SCP did not.

    You can pass the underlying SSH options directly with the -o option with SCP. For example:

    scp -o "User=coucou@kiki:SSH:myname" 11.1.1:/var/log/apache /var/log1