scp

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

scp

Samba - linux mailing list
Connected to my router are desktop and laptop computers. In the desktop
user's home directory is a test text file. I couldn't copy it to a
similar location on the laptop! I don't understand the failure!
--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
Bryan,

On 07/09/17 00:44, Bryan Kilgallin (iiNet) via linux wrote:
> Connected to my router are desktop and laptop computers. In the desktop user's home directory is a test text file. I couldn't copy it to a similar location on the laptop! I don't understand the failure!

You really need to provide more details. Show the commands you ran, and the errors/failures you experienced.

--
Eyal Lebedinsky ([hidden email])

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list


On 07/09/17 00:44, Bryan Kilgallin (iiNet) via linux wrote:
> Connected to my router are desktop and laptop computers. In the desktop
> user's home directory is a test text file. I couldn't copy it to a
> similar location on the laptop! I don't understand the failure!

One way to do what I (have to) guess what you are trying to do (assuming
this is Linux):-

scott@aspire ~ $ whoami;pwd
scott
/home/scott
scott@aspire ~ $ date +%d%m%Y-%H%M > text.txt
scott@aspire ~ $ cat text.txt
07092017-1102
scott@aspire ~ $ ping -c1 testing.sunnyside
PING testing.sunnyside (192.168.0.4) 56(84) bytes of data.
64 bytes from testing.sunnyside (192.168.0.4): icmp_seq=1 ttl=64
time=0.561 ms

--- testing.sunnyside ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.561/0.561/0.561/0.000 ms
scott@aspire ~ $ grep testing /etc/hosts
192.168.0.4     testing.sunnyside testing
scott@aspire ~ $ ssh-copy-id testing.sunnyside
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
"/home/scott/.ssh/id_rsa.pub"
The authenticity of host 'testing.sunnyside (192.168.0.4)' can't be
established.
ECDSA key fingerprint is SHA256:7hq6r1rAtp21F02ezejaoJ/mBfGSo4QJ9dBTBR3NgZY.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to
filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you
are prompted now it is to install the new keys
[hidden email]'s password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'testing.sunnyside'"
and check to make sure that only the key(s) you wanted were added.

scott@aspire ~ $ scp text.txt testing.sunnyside:/home/scott
text.txt
     100%   14     3.9KB/s   00:00
scott@aspire ~ $ ssh testing.sunnyside "cat /home/scott/text.txt"
07092017-1102




Kind regards

--
    A: Because we read from top to bottom, left to right.
    Q: Why should I start my reply below the quoted text?

    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?

    A: The lost context.
    Q: What makes top-posted replies harder to read than bottom-posted?

    A: Yes.
    Q: Should I trim down the quoted part of an email to which I'm reply

http://www.idallen.com/topposting.html

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
Thanks, Scott:

> scott@aspire ~ $ whoami;pwd
> scott
> /home/scott
> scott@aspire ~ $ date +%d%m%Y-%H%M > text.txt
> scott@aspire ~ $ cat text.txt
> 07092017-1102
> scott@aspire ~ $ ping -c1 testing.sunnyside
> PING testing.sunnyside (192.168.0.4) 56(84) bytes of data.
> 64 bytes from testing.sunnyside (192.168.0.4): icmp_seq=1 ttl=64
> time=0.561 ms
>
> --- testing.sunnyside ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 0.561/0.561/0.561/0.000 ms

 From my tower PC to the laptop, all of these tests passed.

> scott@aspire ~ $ grep testing /etc/hosts
> 192.168.0.4     testing.sunnyside testing

Unfortunately the hosts lists on both tower PC and laptop--did not
contain the laptop's hostname! Rather, on the laptop, hosts has the
following line.
127.0.1.1    clug01
Which latter differs from the entry in the following file.
/etc/hostname

--
www.netspeed.com.au/bryan/


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
On 07/09/17 12:04, Bryan Kilgallin (iiNet) via linux wrote:

> Thanks, Scott:
>
>> scott@aspire ~ $ ping -c1 testing.sunnyside
>> PING testing.sunnyside (192.168.0.4) 56(84) bytes of data.
>> 64 bytes from testing.sunnyside (192.168.0.4): icmp_seq=1 ttl=64
>> time=0.561 ms
>>
>> --- testing.sunnyside ping statistics ---
>> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
>> rtt min/avg/max/mdev = 0.561/0.561/0.561/0.000 ms
>
> From my tower PC to the laptop, all of these tests passed.
>
>> scott@aspire ~ $ grep testing /etc/hosts
>> 192.168.0.4     testing.sunnyside testing
>
> Unfortunately the hosts lists on both tower PC and laptop--did not
> contain the laptop's hostname! Rather, on the laptop, hosts has the
> following line.
> 127.0.1.1    clug01
> Which latter differs from the entry in the following file.
> /etc/hostname
>
That's probably still OK.  If the ping worked, it's getting the hostname
from your router, most probably.

Keep going with the commands from Scott, but note that the ssh-copy-id
command is not necessary.  It will save you from having to enter your
password on subsequent logins.

Also add '-vvv' the the scp command, so it gives you (very very) verbose
output.  Taking Scott's example, make it:

        scp -vvv text.txt testing.sunnyside:/home/scott

Tony


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list


On 07/09/17 12:04, Bryan Kilgallin (iiNet) via linux wrote:

> Thanks, Scott:
>
>> scott@aspire ~ $ whoami;pwd
>> scott
>> /home/scott
>> scott@aspire ~ $ date +%d%m%Y-%H%M > text.txt
>> scott@aspire ~ $ cat text.txt
>> 07092017-1102
>> scott@aspire ~ $ ping -c1 testing.sunnyside
>> PING testing.sunnyside (192.168.0.4) 56(84) bytes of data.
>> 64 bytes from testing.sunnyside (192.168.0.4): icmp_seq=1 ttl=64
>> time=0.561 ms
>>
>> --- testing.sunnyside ping statistics ---
>> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
>> rtt min/avg/max/mdev = 0.561/0.561/0.561/0.000 ms
>
> From my tower PC to the laptop, all of these tests passed.

I assume you mean you could ping $laptop from $hostname....

>
>> scott@aspire ~ $ grep testing /etc/hosts
>> 192.168.0.4     testing.sunnyside testing
>
> Unfortunately the hosts lists on both tower PC and laptop--did not
> contain the laptop's hostname!

Confusing - as you just wrote that you could ping it.... or where you
somehow believing you could ping the computer name (testing.sunnyside)
or IP address I used in the example?!! (you can't).

 Rather, on the laptop, hosts has the
> following line.
> 127.0.1.1    clug01
> Which latter differs from the entry in the following file.
> /etc/hostname


/etc/hostname defines the name of *that* computer (which ever computer
that file is on, not other computers).
/etc/hosts is used by *that* computer to resolve hostnames, mostly of
*other* computers (and other 'names' like localhost) into IP addresses.
/etc/hosts is only useful for static addresses.

If you use a computer "name" (e.g. ping google.com at the CLI, or try
and load google in a web browser) the first place that is checked is
/etc/hosts
If there isn't an entry for "google.com" there a nameserver is queried.
On a small LAN like your you may not be running a local nameserver so to
uses computer names at the CLI you need to add an entry in /etc/hosts

See "man hosts" (note that you likely do have a form of a local
nameserver, avahai, but I'm trying to keep this simple and brief)


Replace $laptop and $tower with the actual names.

If you wish to send a file from $tower to $laptop:-

 'Ideally' on $tower you should generate an ssh key using "ssh-keygen"
and then authenticate that key on $laptop using "ssh-copy-id" - OR
you'll have use password authentication (and enable it in the ssh policy
on $laptop if disabled by good security policy)

 'Ideally' /etc/hosts on $tower should contain an entry for $laptop *if*
$laptop has a static IP address - OR just type the IP address instead of
using the hostname

To add an entry to /etc/hosts on $tower, replace $laptop_IP with the IP
address of $laptop:-

sudo echo "$laptop_IP    clug01" >> /etc/hosts

After which you can test by checking the output of:-
ping clug01


A quick search on the internet should give you plenty of better guides
to using scp to copy a file across a local network than the above - and
a long list of alternative techniques.
"man scp" (the -v is the key to problem solving, likewise with ssh issues)


NOTES: For a GUI in a console, if you have MC installed you can do
"sHell link" (under the Left and Right tabs) F9. There is built-in help.
For a desktop GUI, if you have KDE you can just use fishIO in Dolphin
(type "fish:/$laptop" into the Browse URL). Other desktop's file
browsers have similar methods of allowing network file transfer.



Kind regards



--
    A: Because we read from top to bottom, left to right.
    Q: Why should I start my reply below the quoted text?

    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?

    A: The lost context.
    Q: What makes top-posted replies harder to read than bottom-posted?

    A: Yes.
    Q: Should I trim down the quoted part of an email to which I'm reply

http://www.idallen.com/topposting.html

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
I'm trying, Eyal:

> Show the commands you ran, and
> the errors/failures you experienced.

 From the desktop PC's user directory.

{
scp -v Test.txt me@laptop:~/
...
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
...
debug1: Connection established.
...
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: Remote protocol version 2.0, remote software version
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH* compat
0x04000000
...
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [hidden email]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [hidden email] MAC:
<implicit> compression: none
debug1: kex: client->server cipher: [hidden email] MAC:
<implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
...
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
...
debug1: Next authentication method: password
...
debug1: Authentication succeeded (password).
...
debug1: channel 0: new [client-session]
debug1: Requesting [hidden email]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [hidden email]
want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_AU.UTF-8
debug1: Sending env LC_ADDRESS = en_AU.UTF-8
debug1: Sending env LC_IDENTIFICATION = en_AU.UTF-8
debug1: Sending env LC_MEASUREMENT = en_AU.UTF-8
debug1: Sending env LC_MONETARY = en_AU.UTF-8
debug1: Sending env LC_NAME = en_AU.UTF-8
debug1: Sending env LC_NUMERIC = en_AU.UTF-8
debug1: Sending env LC_PAPER = en_AU.UTF-8
debug1: Sending env LC_TELEPHONE = en_AU.UTF-8
debug1: Sending env LC_TIME = en_AU.UTF-8
debug1: Sending command: scp -v -t ~/
...
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2400, received 2616 bytes, in 0.2 seconds
Bytes per second: sent 12374.9, received 13488.6
debug1: Exit status 0
}

The terminal returns to desktop user prompt. But on the laptop there's
no sign of that 15-byte test file!
--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
Thank you Bryan. Just... Thank you.


--
MC

On 7 Sep. 2017 6:50 pm, "Bryan Kilgallin (iiNet) via linux" <
[hidden email]> wrote:

> I'm trying, Eyal:
>
> Show the commands you ran, and the errors/failures you experienced.
>>
>
> From the desktop PC's user directory.
>
> {
> scp -v Test.txt me@laptop:~/
> ...
> OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: /etc/ssh/ssh_config line 19: Applying options for *
> ...
> debug1: Connection established.
> ...
> debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
> debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2
> Ubuntu-4ubuntu2.2
> debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH* compat
> 0x04000000
> ...
> debug1: SSH2_MSG_KEXINIT sent
> debug1: SSH2_MSG_KEXINIT received
> debug1: kex: algorithm: [hidden email]
> debug1: kex: host key algorithm: ecdsa-sha2-nistp256
> debug1: kex: server->client cipher: [hidden email] MAC:
> <implicit> compression: none
> debug1: kex: client->server cipher: [hidden email] MAC:
> <implicit> compression: none
> debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
> ...
> debug1: rekey after 134217728 blocks
> debug1: SSH2_MSG_NEWKEYS sent
> debug1: expecting SSH2_MSG_NEWKEYS
> debug1: rekey after 134217728 blocks
> debug1: SSH2_MSG_NEWKEYS received
> debug1: SSH2_MSG_EXT_INFO received
> debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
> debug1: SSH2_MSG_SERVICE_ACCEPT received
> debug1: Authentications that can continue: publickey,password
> debug1: Next authentication method: publickey
> ...
> debug1: Next authentication method: password
> ...
> debug1: Authentication succeeded (password).
> ...
> debug1: channel 0: new [client-session]
> debug1: Requesting [hidden email]
> debug1: Entering interactive session.
> debug1: pledge: network
> debug1: client_input_global_request: rtype [hidden email]
> want_reply 0
> debug1: Sending environment.
> debug1: Sending env LANG = en_AU.UTF-8
> debug1: Sending env LC_ADDRESS = en_AU.UTF-8
> debug1: Sending env LC_IDENTIFICATION = en_AU.UTF-8
> debug1: Sending env LC_MEASUREMENT = en_AU.UTF-8
> debug1: Sending env LC_MONETARY = en_AU.UTF-8
> debug1: Sending env LC_NAME = en_AU.UTF-8
> debug1: Sending env LC_NUMERIC = en_AU.UTF-8
> debug1: Sending env LC_PAPER = en_AU.UTF-8
> debug1: Sending env LC_TELEPHONE = en_AU.UTF-8
> debug1: Sending env LC_TIME = en_AU.UTF-8
> debug1: Sending command: scp -v -t ~/
> ...
> debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
> debug1: channel 0: free: client-session, nchannels 1
> debug1: fd 0 clearing O_NONBLOCK
> debug1: fd 1 clearing O_NONBLOCK
> Transferred: sent 2400, received 2616 bytes, in 0.2 seconds
> Bytes per second: sent 12374.9, received 13488.6
> debug1: Exit status 0
> }
>
> The terminal returns to desktop user prompt. But on the laptop there's no
> sign of that 15-byte test file!
> --
> www.netspeed.com.au/bryan/
>
> --
> linux mailing list
> [hidden email]
> https://lists.samba.org/mailman/listinfo/linux
>
--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
On 07/09/17 18:48, Bryan Kilgallin (iiNet) via linux wrote:
> I'm trying, Eyal:
>
>> Show the commands you ran, and the errors/failures you experienced.
>
>  From the desktop PC's user directory.
>
> {
> scp -v Test.txt me@laptop:~/

If I am a real paranoid (is this really a tilde?) then I would try
$ scp -v Test.txt me@laptop

> ...
> OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: /etc/ssh/ssh_config line 19: Applying options for *
> ...
> debug1: Connection established.
> ...
> debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
> debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
> debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH* compat 0x04000000
> ...
> debug1: SSH2_MSG_KEXINIT sent
> debug1: SSH2_MSG_KEXINIT received
> debug1: kex: algorithm: [hidden email]
> debug1: kex: host key algorithm: ecdsa-sha2-nistp256
> debug1: kex: server->client cipher: [hidden email] MAC: <implicit> compression: none
> debug1: kex: client->server cipher: [hidden email] MAC: <implicit> compression: none
> debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
> ...
> debug1: rekey after 134217728 blocks
> debug1: SSH2_MSG_NEWKEYS sent
> debug1: expecting SSH2_MSG_NEWKEYS
> debug1: rekey after 134217728 blocks
> debug1: SSH2_MSG_NEWKEYS received
> debug1: SSH2_MSG_EXT_INFO received
> debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
> debug1: SSH2_MSG_SERVICE_ACCEPT received
> debug1: Authentications that can continue: publickey,password
> debug1: Next authentication method: publickey
> ...
> debug1: Next authentication method: password
> ...
> debug1: Authentication succeeded (password).
> ...
> debug1: channel 0: new [client-session]
> debug1: Requesting [hidden email]
> debug1: Entering interactive session.
> debug1: pledge: network
> debug1: client_input_global_request: rtype [hidden email] want_reply 0
> debug1: Sending environment.
> debug1: Sending env LANG = en_AU.UTF-8
> debug1: Sending env LC_ADDRESS = en_AU.UTF-8
> debug1: Sending env LC_IDENTIFICATION = en_AU.UTF-8
> debug1: Sending env LC_MEASUREMENT = en_AU.UTF-8
> debug1: Sending env LC_MONETARY = en_AU.UTF-8
> debug1: Sending env LC_NAME = en_AU.UTF-8
> debug1: Sending env LC_NUMERIC = en_AU.UTF-8
> debug1: Sending env LC_PAPER = en_AU.UTF-8
> debug1: Sending env LC_TELEPHONE = en_AU.UTF-8
> debug1: Sending env LC_TIME = en_AU.UTF-8
> debug1: Sending command: scp -v -t ~/

When I run this command, the next messages (which you removed?) are the important ones:
Sending file modes: C0664 14037 Test.txt
Sink: C0664 14037 Test.txt
Test.txt                                                                                                                                                                       100%   14KB  13.0MB/s   00:00
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0

> ...
> debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
> debug1: channel 0: free: client-session, nchannels 1
> debug1: fd 0 clearing O_NONBLOCK
> debug1: fd 1 clearing O_NONBLOCK
> Transferred: sent 2400, received 2616 bytes, in 0.2 seconds
> Bytes per second: sent 12374.9, received 13488.6
> debug1: Exit status 0
> }
>
> The terminal returns to desktop user prompt. But on the laptop there's no sign of that 15-byte test file!

Are you sure that on the laptop you are logged in as user 'me'? Try
$ ssh me@laptop ls -ltr

--
Eyal Lebedinsky ([hidden email])

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
Unfortunately no, Scott:

> scott@aspire ~ $ ssh-copy-id testing.sunnyside

{
/usr/bin/ssh-copy-id: ERROR: failed to open ID file
}
Complaining that there was no such ".pub" file in my desktop user directory!
--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
On 7 September 2017 at 19:35, Eyal Lebedinsky via linux <
[hidden email]> wrote:
>
>
> Are you sure that on the laptop you are logged in as user 'me'? Try
> $ ssh me@laptop ls -ltr


I would be trying more along these lines - the scp is clearly (based on
debug output) getting through to something over ssh but you're not sure
about some combination of what, who or where.

Trying:
 $ ssh me@laptop pwd
 $ ssh me@laptop whoami
 $ ssh me@laptop hostname

or simply leaving out the command ($ ssh me@laptop) and poking around on
the shell will likely show something obvious.


Cheers,
Dave
--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list


On 07/09/17 19:47, Bryan Kilgallin (iiNet) via linux wrote:
> Unfortunately no, Scott:
>
>> scott@aspire ~ $ ssh-copy-id testing.sunnyside


First run ssh-keygen to create a key on $tower
You must replace $tower with the actual name of your tower pc.
You must replace $laptop with the actual name of your laptop OR it's IP
address

>
> {
> /usr/bin/ssh-copy-id: ERROR: failed to open ID file
> }
> Complaining that there was no such ".pub" file in my desktop user
> directory!

First you need to generate a key!  See my previous comments...
quote:-

> If you wish to send a file from $tower to $laptop:-
>
>  'Ideally' on $tower you should generate an ssh key using "ssh-keygen"
> and then authenticate that key on $laptop using "ssh-copy-id"

"man ssh-keygen" if you don't understand how to generate a key or can't
find a suitable tutorial on the internet (why reinvent the wheel?).


Notes: if you use the ssh or scp command without specifying a user, the
command assumes you mean run as the current user. i.e. if you are logged
in as "brian" @tower and "scp text.txt laptop:/$somewhere", the command
run is the equivalent of "scp text.txt brian@laptop:/$somewhere" (so you
better have a user with the same name on $laptop).


When you've run ssh-keygen on $tower you will have a directory created
in ~ called ~/.ssh

typical contents on $tower:/home/brian/.ssh is:-
authorized_keys   config       id_rsa.pub   id_rsa            known_hosts

typical contents on $laptop:/home/brian/.ssh when you've installed ssh
and run ssh-copy-id on $tower:-
known_hosts





Kind regards


--
    A: Because we read from top to bottom, left to right.
    Q: Why should I start my reply below the quoted text?

    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?

    A: The lost context.
    Q: What makes top-posted replies harder to read than bottom-posted?

    A: Yes.
    Q: Should I trim down the quoted part of an email to which I'm reply

http://www.idallen.com/topposting.html

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
On 07/09/17 19:35, Eyal Lebedinsky via linux wrote:
> If I am a real paranoid (is this really a tilde?) then I would try
> $ scp -v Test.txt me@laptop

That will just do a normal copy to a local file named me@laptop


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
On 07/09/17 20:11, Tony Lewis via linux wrote:
> On 07/09/17 19:35, Eyal Lebedinsky via linux wrote:
>> If I am a real paranoid (is this really a tilde?) then I would try
>> $ scp -v Test.txt me@laptop
>
> That will just do a normal copy to a local file named me@laptop

oops, lost the colon:

$ scp -v Test.txt me@laptop:

--
Eyal Lebedinsky ([hidden email])

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list


On 07/09/17 20:11, Tony Lewis via linux wrote:
> On 07/09/17 19:35, Eyal Lebedinsky via linux wrote:
>> If I am a real paranoid (is this really a tilde?) then I would try
>> $ scp -v Test.txt me@laptop
>
> That will just do a normal copy to a local file named me@laptop


?
If there is a user called me on $laptop, it'll fail (silently), because
it'll 'try' to write to the root of $laptop, where "me" doesn't have
write permissions... (?)

i.e. needs to be "scp $laptop:/home/$username/$somewhere" or "scp
$laptop:~/$somewhere_beneath_$users_home"

if "me" is the same user name on $laptop as $tower it's redundant... as
scp and ssh etc assume the login uses the same name as the person
running the command if it's not given on the command line.

Note that the error output described the problem - Brian hasn't
generated an ssh key, so the key copy fails.

Kind regards

--
    A: Because we read from top to bottom, left to right.
    Q: Why should I start my reply below the quoted text?

    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?

    A: The lost context.
    Q: What makes top-posted replies harder to read than bottom-posted?

    A: Yes.
    Q: Should I trim down the quoted part of an email to which I'm reply

http://www.idallen.com/topposting.html

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
Yes, Tony:

>> $ scp -v Test.txt me@laptop
>
> That will just do a normal copy to a local file named me@laptop
Verified (that was the case).
--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list


On 07/09/17 20:19, Scott Ferguson via linux wrote:

>
> On 07/09/17 20:11, Tony Lewis via linux wrote:
>> On 07/09/17 19:35, Eyal Lebedinsky via linux wrote:
>>> If I am a real paranoid (is this really a tilde?) then I would try
>>> $ scp -v Test.txt me@laptop
>> That will just do a normal copy to a local file named me@laptop
>
> ?
> If there is a user called me on $laptop, it'll fail (silently), because
> it'll 'try' to write to the root of $laptop, where "me" doesn't have
> write permissions... (?)

If it doesn't fit the pattern of a remote file, it creates a local file
of the same name.  I suspect the pattern is something along the lines of
[<user>]@<host>:[<path>]

This is just my observation of behaviour.  I haven't looked into it.


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
Nope, Eyal:

> $ scp -v Test.txt me@laptop:

Still there's no sign of a copied file on the laptop.

How is the program interpreting syntactical guesses?
--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list


On 07/09/17 20:35, Tony Lewis via linux wrote:

>
>
> On 07/09/17 20:19, Scott Ferguson via linux wrote:
>>
>> On 07/09/17 20:11, Tony Lewis via linux wrote:
>>> On 07/09/17 19:35, Eyal Lebedinsky via linux wrote:
>>>> If I am a real paranoid (is this really a tilde?) then I would try
>>>> $ scp -v Test.txt me@laptop
>>> That will just do a normal copy to a local file named me@laptop
>>
>> ?
>> If there is a user called me on $laptop, it'll fail (silently), because
>> it'll 'try' to write to the root of $laptop, where "me" doesn't have
>> write permissions... (?)

Scratch my comment about trying to write to the root, I've since
received Eyal's post about the missing :

I 'assumed' you'd meant "$ scp -v Test.txt me@$laptop"

>
> If it doesn't fit the pattern of a remote file, it creates a local file
> of the same name.  

! Interesting.

> I suspect the pattern is something along the lines of
> [<user>]@<host>:[<path>]

It seems, any valid characters for a file/directory/path
>
> This is just my observation of behaviour.  I haven't looked into it.
>
>

Kind regards

--
    A: Because we read from top to bottom, left to right.
    Q: Why should I start my reply below the quoted text?

    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?

    A: The lost context.
    Q: What makes top-posted replies harder to read than bottom-posted?

    A: Yes.
    Q: Should I trim down the quoted part of an email to which I'm reply

http://www.idallen.com/topposting.html

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: scp

Samba - linux mailing list
In reply to this post by Samba - linux mailing list
Thanks, Scott:

>>  From my tower PC to the laptop, all of these tests passed.
>
> I assume you mean you could ping $laptop from $hostname.

Yes, ping works fine from tower to laptop and vice versa.

>> Unfortunately the hosts lists on both tower PC and laptop--did not
>> contain the laptop's hostname!
>
> Confusing - as you just wrote that you could ping it.... or where you
> somehow believing you could ping the computer name (testing.sunnyside)
> or IP address I used in the example?

EtherApe reports IP addresses according to the router.

> /etc/hosts is only useful for static addresses.

I haven't moved the router cables in the week that the laptop has been
connected.

> See "man hosts" (note that you likely do have a form of a local
> nameserver, avahai, but I'm trying to keep this simple and brief)

Under the topic "ps aux", I have listed an avahi daemon user here.

https://lists.samba.org/archive/linux/2017-September/036341.html

> If you wish to send a file from $tower to $laptop:-
>
>   'Ideally' on $tower you should generate an ssh key using "ssh-keygen"
> and then authenticate that key on $laptop using "ssh-copy-id" - OR
> you'll have use password authentication (and enable it in the ssh policy
> on $laptop if disabled by good security policy)

I am not familiar doing those actions!

> To add an entry to /etc/hosts on $tower, replace $laptop_IP with the IP
> address of $laptop:-
>
> sudo echo "$laptop_IP    clug01" >> /etc/hosts

{
An error occurred while redirecting file '/etc/hosts'
open: Permission denied
}

> A quick search on the internet should give you plenty of better guides
> to using scp to copy a file across a local network than the above - and
> a long list of alternative techniques.

I did try such suggestions--unsuccessfully!

> NOTES: For a GUI in a console, if you have MC installed you can do
> "sHell link" (under the Left and Right tabs) F9.

I had no trouble with ssh from the tower to the laptop.
However, attempting to ssh from the laptop to the tower--resulted in an
ssh error, saying that connection to the tower host via port 22--was
refused!

> For a desktop GUI, if you have KDE you can just use fishIO in Dolphin
> (type "fish:/$laptop" into the Browse URL). Other desktop's file
> browsers have similar methods of allowing network file transfer.

I have just installed Midnight Commander on the tower.

--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
12