1

I'm trying to send a file to a remote system:

@ravi@svelte:~$ scp /etc/btrbk/btrbk.conf ravi@tara:
All keys already loaded
ssh: Could not resolve hostname /etc/btrbk/btrbk.conf: Name or service not known
@ravi@svelte:~[255]$ ls -l /etc/btrbk/btrbk.conf
-rw-r--r-- 1 root root 5,558 Feb 19 20:06 /etc/btrbk/btrbk.conf
@ravi@svelte:~$ 

Why is scp thinking that the first argument is a hostname, rather than a filename?

I'm running OpenSSH_7.4p1, OpenSSL 1.0.2j 26 Sep 2016.

2
  • 1
    What is scp in your system? It looks like some alias or bash function. What does type scp return? Do you have something in you ssh_config?
    – Jakuje
    Feb 20, 2017 at 10:47
  • Thanks, I had ~/bin/scp as a symlink to /usr/bin/ssh-ident. I've raised an issue for this.
    – Tom Hale
    Feb 20, 2017 at 11:02

2 Answers 2

1

There is a problem, that your scp is symlink to something that does not accept the syntax of scp.

As you already pointed out in the comments, the problem comes from ssh-ident. Not sure how did you install it or set it up, but it is most probably bug there.

1
  • ssh-ident is a python script which is designed to be symlinked to and behaves based on the name of the symlink. Issue raised.
    – Tom Hale
    Feb 20, 2017 at 12:18
0

This is due to an incorrect syntax. From scp manual:

 scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2

You have to tell scp where you want to put the file after the semicolon, i.e:

@ravi@svelte:~$ scp /etc/btrbk/btrbk.conf ravi@tara:/path_to_file
1
  • No: scp /etc/btrbk/btrbk.conf ravi@tara:/tmp/path_to_file gives output: ssh: Could not resolve hostname /etc/btrbk/btrbk.conf: Name or service not known
    – Tom Hale
    Feb 20, 2017 at 10:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .