Very basic: scp does not work—what am I missing?

This really is so basic.

On 192.168.57.19 I have this:

truenas_admin@truenasmini[~/scripts]$ pwd
/home/truenas_admin/scripts
truenas_admin@truenasmini[~/scripts]$ ls -la
total 9
drwxr-xr-x 2 truenas_admin truenas_admin 2 Dec 26 13:51 .
drwx------ 4 truenas_admin truenas_admin 7 Dec 26 14:18 ..

On 192.168.57.240 I have this

truenas_admin@truenasmini[~/scripts]$ pwd
/home/truenas_admin/scripts
truenas_admin@truenasmini[~/scripts]$ ls -la
total 21485
drwxr-xr-x 2 truenas_admin truenas_admin       10 Dec 26 13:51 .
drwx------ 6 truenas_admin truenas_admin       15 Dec 26 14:18 ..
-rw-r--r-- 1 truenas_admin truenas_admin 29849600 Dec 26 14:20 scripts.tar

Trying to copy scripts.tar from 192.168.57.240 to 192.168.57.19 with this command:

truenas_admin@truenasmini[~/scripts]$ scp ./scripts.tar truenas_admin@192.168.57.19:/home/truenas_admin/scripts/scripts.tar
Enter passphrase for key '/home/truenas_admin/.ssh/id_rsa': 
scripts.tar                                                                                                                                   100%   28MB 469.0MB/s   00:00    

So, it looks like scripts.tar was copied to /home/truenas_admin/scripts/, but that directory is still empty:

truenas_admin@truenasmini[~/scripts]$ pwd
/home/truenas_admin/scripts
truenas_admin@truenasmini[~/scripts]$ ls -la
total 9
drwxr-xr-x 2 truenas_admin truenas_admin 2 Dec 26 13:51 .
drwx------ 4 truenas_admin truenas_admin 7 Dec 26 15:14 ..

I know this should go into a Linux forum, but I am stumped and do not frequent any Linux forums. What might be going on?

permissions? have you tried with sudo?

I had posted, before I was done with it. Feel free to look at my edited, more detailed post.

This must have something to do with it:

dominik@dominikmbp ~ % ssh truenas_admin@192.168.57.19
Enter passphrase for key '/Users/dominik/.ssh/id_rsa': 
Connection reset by 192.168.57.19 port 22

This is trying to connect from my MacBook Pro’s command line.

I got it straightened out.

  1. I deleted ~/.ssh
  2. I put the authorized key into Credentials→Users→Edit Users→Public SSH Key.
  3. I then executed scp truenas_admin@192.168.57.240:~/scripts/scripts.tar ~/Desktop/and scp ~/Desktop/scripts.tar truenas_admin@192.168.57.19:~/scripts/.

I never did try doing scp ~/scripts/scripts.tar truenas_admin@192.168.57.19:~/scripts/ on the host 192.168.57.240 directly after going through Step 2. Still, I think configuring the authorized key through the GUI was essential.

1 Like