Results 1 to 4 of 4

Thread: Problem with scp

  1. #1
    Join Date
    Dec 2006
    Beans
    16

    Problem with scp

    Hi

    I'm having a problem with scp on a local network.
    I can connect with
    Code:
    ssh -p 2222 and username@192.168.0.1
    with no problems.

    If I try to
    Code:
     scp -p 2222 file1 username@192.168.0.4:/home/username/file1
    I get ssh: connect to host 192.168.0.4 port 22: Connection refused

    Do I need to set the port for scp somewhere else? or does it does it pick it up from /etc/ssh/sshd_config file as with the server? I'm sure I only set ip up for the ssh sever in the past.

  2. #2
    Join Date
    May 2007
    Beans
    33
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with scp

    I believe it is:

    Code:
    scp -P 2222 file1 username@192.168.0.4:/home/username/file1
    With a capital P

  3. #3
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Problem with scp

    Quote Originally Posted by gazza7 View Post
    Hi

    I'm having a problem with scp on a local network.
    I can connect with
    Code:
    ssh -p 2222 and username@192.168.0.1
    with no problems.

    If I try to
    Code:
     scp -p 2222 file1 username@192.168.0.4:/home/username/file1
    I get ssh: connect to host 192.168.0.4 port 22: Connection refused

    Do I need to set the port for scp somewhere else? or does it does it pick it up from /etc/ssh/sshd_config file as with the server? I'm sure I only set ip up for the ssh sever in the past.
    - Are those two different computers?

    - Are you running scp in linux? Then you should have capital -P for port number
    Last edited by sudodus; February 9th, 2013 at 04:54 PM. Reason: ninja'd

  4. #4
    Join Date
    Dec 2006
    Beans
    16

    Re: Problem with scp

    Hi

    Thanks

    I was just looking at the help and I didn't notice its a capital P for scp compared with a lowercase p with ssh. Sometimes you can't see the wood for the trees.

    Thanks again to you both for your help, its now working.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •