1

while reading about file transter in linux I got: We can also move files securely using Secure Copy (scp) between two networked hosts. scp uses the SSH protocol for transferring data.

To copy a local file to a remote system, at the command prompt, type scp :/home/user/ and press Enter.

and I tried this on one of me peer(in same wifi connection) and I got:

anupam@JAZZ:~$ scp data.txt divesh@192.168.1.2:Desktop/
ssh: connect to host 192.168.1.2 port 22: Connection refused
lost connection
anupam@JAZZ:~$ ssh -p 10022 divesh@192.168.1.2
ssh: connect to host 192.168.1.2 port 10022: Connection refused
anupam@JAZZ:~$ ssh -p 10022 divesh@192.168.1.2
ssh: connect to host 192.168.1.2 port 10022: Connection refused
anupam@JAZZ:~$ 

how can I resolve this??

3

Yes you can use SCP

But make sure you have ssh server running on both machine (install it if not installed)

sudo apt-get install openssh-server
  • You only need openssh-server on systems which you're connecting to remotely - scp can handle local-to-remote as well. (The only time you need openssh-server on the system you're on, i.e. JAZZ in the OP's example, is if you're going to connect ot it from the other "remote" system that isn't JAZZ) – Thomas Ward Oct 13 '14 at 16:18
  • If its 1 way copy from A to B then you need ssh server running on B only, but its also a good idea to have it installed on A and B, or if you only use A to copy from and to B. But you can not copy from/to A using B unless its stalled on A – AdigaJo Oct 13 '14 at 16:21
  • No, it's not a good idea, unless you have your firewall filtering the SSH access to local network traffic only. Having openssh-server on a computer that does not need it is a security risk and opens your computer to possible exploitation and breaches. (As an IT security person, I know this to be fact) – Thomas Ward Oct 13 '14 at 16:22
  • thanx @ AdigaJo ,it worked now. – lazarus Oct 13 '14 at 16:23
  • Welcome, And its not really security risk if you have a strong password and/or behind a router. – AdigaJo Oct 13 '14 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.