[SOLVED] scp copy from host to nas not working

Discussion about using NAS on Linux and Unix OS.
Post Reply
carlos08
New here
Posts: 6
Joined: Sat May 04, 2019 10:29 pm

[SOLVED] scp copy from host to nas not working

Post by carlos08 »

I am trying to copy files to my TS-251+ from a Linux Mint (Tessa) 19.1 computer (host) on the same sub-network. My objective is to save the files’ timestamps, and so I wish to use “scp -p” to do so. Skipping the “-p” option for the moment, I enter the following verbose command:

Code: Select all

scp -vvv /home/carl/test admin@192.168.1.8:/Public
The output received in the terminal is the following:

Code: Select all

Executing: program /usr/bin/ssh host 192.168.1.8, user admin, command scp -v -t /Public
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.1.8" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.1.8 [192.168.1.8] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carl/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.0
debug1: match: OpenSSH_8.0 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.8:22 as 'admin'
debug3: hostkeys_foreach: reading file "/home/carl/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/carl/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from 192.168.1.8
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:(removed this text)
debug3: hostkeys_foreach: reading file "/home/carl/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/carl/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from 192.168.1.8
debug1: Host '192.168.1.8' is known and matches the RSA host key.
debug1: Found key in /home/carl/.ssh/known_hosts:2
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /home/carl/.ssh/id_rsa ((nil))
debug2: key: /home/carl/.ssh/id_dsa ((nil))
debug2: key: /home/carl/.ssh/id_ecdsa ((nil))
debug2: key: /home/carl/.ssh/id_ed25519 ((nil))
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/carl/.ssh/id_rsa
debug3: no such identity: /home/carl/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/carl/.ssh/id_dsa
debug3: no such identity: /home/carl/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/carl/.ssh/id_ecdsa
debug3: no such identity: /home/carl/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/carl/.ssh/id_ed25519
debug3: no such identity: /home/carl/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug3: send packet: type 50
debug2: we sent a keyboard-interactive packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: userauth_kbdint: disable: no info_req_seen
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: 
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
admin@192.168.1.8's password: 
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (password).
Authenticated to 192.168.1.8 ([192.168.1.8]:22).
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x08
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug1: Sending env LC_MEASUREMENT = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug1: Sending env LC_PAPER = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug1: Sending env LC_MONETARY = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env GDM_LANG
debug3: Ignored env DISPLAY
debug3: Ignored env GTK_OVERLAY_SCROLLING
debug3: Ignored env COLORTERM
debug3: Ignored env XDG_VTNR
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env MANDATORY_PATH
debug1: Sending env LC_NAME = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env XDG_GREETER_DATA_DIR
debug3: Ignored env USER
debug3: Ignored env DESKTOP_SESSION
debug3: Ignored env GNOME_TERMINAL_SCREEN
debug3: Ignored env DEFAULTS_PATH
debug3: Ignored env PWD
debug3: Ignored env HOME
debug3: Ignored env SSH_AGENT_PID
debug3: Ignored env QT_ACCESSIBILITY
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env XDG_SESSION_DESKTOP
debug1: Sending env LC_ADDRESS = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env GJS_DEBUG_OUTPUT
debug1: Sending env LC_NUMERIC = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env GTK_MODULES
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env VTE_VERSION
debug3: Ignored env XDG_SEAT_PATH
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env GPG_AGENT_INFO
debug3: Ignored env GNOME_TERMINAL_SERVICE
debug3: Ignored env XDG_SEAT
debug3: Ignored env SHLVL
debug3: Ignored env LANGUAGE
debug1: Sending env LC_TELEPHONE = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env GDMSESSION
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env LOGNAME
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env XAUTHORITY
debug3: Ignored env XDG_SESSION_PATH
debug3: Ignored env XDG_CONFIG_DIRS
debug3: Ignored env PATH
debug1: Sending env LC_IDENTIFICATION = nl_NL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env CINNAMON_VERSION
debug3: Ignored env GJS_DEBUG_TOPICS
debug3: Ignored env SESSION_MANAGER
debug3: Ignored env _
debug3: Ignored env OLDPWD
debug1: Sending command: scp -v -t /Public
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
Sending file modes: C0777 6 test
debug2: channel 0: rcvd ext data 19
Sink: C0777 6 test
debug2: channel 0: written 19 to efd 6
test                                          100%    6    25.4KB/s   00:00    
debug2: channel 0: read<=0 rfd 4 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug3: send packet: type 96
debug2: channel 0: input drain -> closed
debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)

debug3: send packet: type 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2476, received 3008 bytes, in 0.1 seconds
Bytes per second: sent 41853.3, received 50846.0
debug1: Exit status 0
Without the “-vvv” option, the only output is the single line in the above output that begins with "test" (namely, the file being copied). You would think that after this my test file would be in the nas’s Public folder. BUT it is not, nor--as best I can determine--is it anywhere else on the nas. Any thoughts on what I am doing wrong here?
Last edited by carlos08 on Tue May 07, 2019 6:09 pm, edited 1 time in total.
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: scp copy from host to nas not working

Post by OneCD »

Specify the absolute path to the ‘Public’ share on the target NAS [/share/Public].

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
Don
Guru
Posts: 12289
Joined: Thu Jan 03, 2008 4:56 am
Location: Long Island, New York

Re: scp copy from host to nas not working

Post by Don »

Why not use rsync and Hybrid Backup Station? rsync will preserve timestamps.
Use the forum search feature before posting.

Use RAID and external backups. RAID will protect you from disk failure, keep your system running, and data accessible while the disk is replaced, and the RAID rebuilt. Backups will allow you to recover data that is lost or corrupted, or from system failure. One does not replace the other.

NAS: TVS-882BR | F/W: 5.0.1.2346 | 40GB | 2 x 1TB M.2 SATA RAID 1 (System/VMs) | 3 x 1TB M.2 NMVe QM2-4P-384A RAID 5 (cache) | 5 x 14TB Exos HDD RAID 6 (Data) | 1 x Blu-ray
NAS: TVS-h674 | F/W: 5.0.1.2376 | 16GB | 3 x 18TB RAID 5
Apps: DNSMasq, PLEX, iDrive, QVPN, QLMS, MP3fs, HBS3, Entware, DLstation, VS, +
carlos08
New here
Posts: 6
Joined: Sat May 04, 2019 10:29 pm

Re: scp copy from host to nas not working

Post by carlos08 »

Many thanks for responding, OneCD and Don. According to a drag-and-drop from nautilus to a terminal, the absolute path to the NAS’s Public file is '/run/user/1000/gvfs/ftp:host=nas.local,user=carl/Public'. (Note that my nas’s [unimaginative] name is ‘nas’.) Thus according to OneCD, the correct command should be:

Code: Select all

scp -vvv /home/carl/test /run/user/1000/gvfs/ftp:host=nas.local,user=admin/Public
The good news is that this worked! The bad news is that when I change the “-vvv” parameter to “-p”, I get the following error message:
cp: preserving times for '/run/user/1000/gvfs/ftp:host=nas.local,user=carl/Public/test': Operation not supported
So let’s move on to Don’s suggestion. As best I can tell, the rsync command should look something like this:

Code: Select all

rsync -av /home/carl/test /run/user/1000/gvfs/ftp:host=nas.local,user=admin/Public
After execution, this is what appears in the terminal:
sending incremental file list
test
rsync: failed to set times on "/run/user/1000/gvfs/ftp:host=nas.local,user=admin/Public/.test.xJsP1o": Operation not supported (95)

sent 103 bytes received 175 bytes 185.33 bytes/sec
total size is 6 speedup is 0.02
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
Again, I get the same good and bad news. That is, the file is copied, but the timestamp is not preserved.

Something else that might be relevant: I can navagate to the nas’s Public folder with the following commands:

Code: Select all

ssh admin@nas.local
cd /share/CACHEDEV1_DATA/Public
If at this point I try copying the file as follows:

Code: Select all

scp -vvv carl@192.168.1.12:/home/carl/test /share/CACHEDEV1_DATA/Public
I then get this error:
Executing: program /usr/bin/ssh host 192.168.1.12, user carl, command scp -v -f /home/carl/test
OpenSSH_8.0p1, OpenSSL 1.0.2k 26 Jan 2017
debug2: resolve_canonicalize: hostname 192.168.1.12 is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.1.12 [192.168.1.12] port 22.
debug1: connect to address 192.168.1.12 port 22: Connection refused
ssh: connect to host 192.168.1.12 port 22: Connection refused
If I try rsync as follows:

Code: Select all

rsync -av carl@192.168.1.12:/home/carl/test /share/CACHEDEV1_DATA/Public
Then this is what I get:
ssh: connect to host 192.168.1.12 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [Receiver=3.0.7]
Obviously, I’m new to both scp and rsync, and so I remain totally lost at this point. Do you have any other ideas? Keep in mind that all I’m trying here is do a network copy between computer and nas that saves files’ timestamps.

Thanks again for your help so far, OneCD and Don.
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: scp copy from host to nas not working

Post by OneCD »

carlos08 wrote: Tue May 07, 2019 3:52 am Thus according to OneCD, the correct command should be:

Code: Select all

scp -vvv /home/carl/test /run/user/1000/gvfs/ftp:host=nas.local,user=admin/Public
No, not what I was suggesting. You may want to keep GVFS (and FTP) out of this as you're introducing an extra layer of complexity. ;)

Try this instead:

Code: Select all

scp -p /home/carl/test admin@192.168.1.8:/share/Public
BTW: is 'test' a file or directory?

Works fine here. Debian 9.9:

Code: Select all

$ hostname
wstation
$ stat testfile.txt
  File: testfile.txt
  Size: 3620            Blocks: 8          IO Block: 4096   regular file
Device: 804h/2052d      Inode: 3042125     Links: 1
Access: (0640/-rw-r-----)  Uid: ( 1000/    onecd)   Gid: ( 1000/    onecd)
Access: 2019-01-05 12:16:53.147940772 +1000
Modify: 2019-01-05 12:16:53.147940772 +1000
Change: 2019-05-07 06:12:54.037596454 +1000
 Birth: -
$ scp -p testfile.txt admin@sarah:/share/Public/
... to QTS 4.2.6 #20190322:

Code: Select all

[~] # hostname
Sarah
[~] # stat /share/Public/testfile.txt 
  File: "/share/Public/testfile.txt"
  Size: 3620            Blocks: 8          IO Block: 4096   regular file
Device: 900h/2304d      Inode: 68812803    Links: 1
Access: (0640/-rw-r-----)  Uid: (    0/   admin)   Gid: (    0/administrators)
Access: 2019-01-05 12:16:53.000000000
Modify: 2019-01-05 12:16:53.000000000
Change: 2019-05-07 06:17:21.000000000

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
carlos08
New here
Posts: 6
Joined: Sat May 04, 2019 10:29 pm

Re: scp copy from host to nas not working

Post by carlos08 »

Many thanks for your help, OneCD. Both scp and rsync work beautifully, once I change the target to "admin@192.168.1.8:/share/Public". Also, you guessed correctly that "test" is a file. This anticipates my next question, however. How can I modify the scp (or rsync) command for copying directories? I experimented with adding slashes at the ends of both source and target specifications, but each time I get the following error message:
/home/carl/folder: not a regular file
I apologize, but I am really new at this.
carlos08
New here
Posts: 6
Joined: Sat May 04, 2019 10:29 pm

Re: [SOLVED] scp copy from host to nas not working

Post by carlos08 »

Sorry, OneCD. There is no need to respond. The correct commands are easily found elsewhere. For completeness, the commands for copying folders are as follows:

Code: Select all

scp -pr /home/carl/folder admin@192.168.1.8:/share/Public

Code: Select all

rsync -av /home/carl/folder admin@192.168.1.8:/share/Public/
The scp command requires adding the "r" option; the rsync command requires adding a "/" at the end.

Again, many thanks for your help!
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SOLVED] scp copy from host to nas not working

Post by OneCD »

Nicely done. :geek:

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
carlos08
New here
Posts: 6
Joined: Sat May 04, 2019 10:29 pm

Re: [SOLVED] scp copy from host to nas not working

Post by carlos08 »

A final note: rsync has a GUI counterpart, Grsync. This can be set up to copy while preserving time and owner. (Note that you won’t be able to use [non-superuser] nautilus to delete a file copied to the nas, unless the file was copied with its owner preserved.) The GUI’s “Open” buttons allow you to browse for folders to be copied to or from your computer. Grsync provides a check box for “Browse files instead of folders” under its “Extra options” tab. Do not browse for folders or files on the nas, however. Instead, you will avoid errors if you manually enter the destination as shown above. Once files have been copied to the nas, you can use nautilus to move them among the nas’s folders without loosing the files’ timestamps. Pretty slick! :wink:
User avatar
Don
Guru
Posts: 12289
Joined: Thu Jan 03, 2008 4:56 am
Location: Long Island, New York

Re: [SOLVED] scp copy from host to nas not working

Post by Don »

you can also use rsync via Hybrid Backup Sync which would be the preferred method.
Use the forum search feature before posting.

Use RAID and external backups. RAID will protect you from disk failure, keep your system running, and data accessible while the disk is replaced, and the RAID rebuilt. Backups will allow you to recover data that is lost or corrupted, or from system failure. One does not replace the other.

NAS: TVS-882BR | F/W: 5.0.1.2346 | 40GB | 2 x 1TB M.2 SATA RAID 1 (System/VMs) | 3 x 1TB M.2 NMVe QM2-4P-384A RAID 5 (cache) | 5 x 14TB Exos HDD RAID 6 (Data) | 1 x Blu-ray
NAS: TVS-h674 | F/W: 5.0.1.2376 | 16GB | 3 x 18TB RAID 5
Apps: DNSMasq, PLEX, iDrive, QVPN, QLMS, MP3fs, HBS3, Entware, DLstation, VS, +
Post Reply

Return to “Linux & Unix (NFS)”