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@
ssh: connect to host port 22: Connection refused
lost connection
anupam@JAZZ:~$ ssh -p 10022 divesh@
ssh: connect to host port 10022: Connection refused
anupam@JAZZ:~$ ssh -p 10022 divesh@
ssh: connect to host port 10022: Connection refused

how can I resolve this??

1 Answer 1


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, 2014 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, 2014 at 16:21
  • 1
    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, 2014 at 16:22
  • thanx @ AdigaJo ,it worked now.
    – lazarus
    Oct 13, 2014 at 16:23
  • 1
    @AdigaJo anything that is useless/pointless is a security risk. Having a strong password and being behind a router doesn't mean you're secure.
    – Alaa Ali
    Oct 13, 2014 at 16:42

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.