PDA

View Full Version : Problem with scp



gazza7
February 9th, 2013, 04:44 PM
Hi

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

If I try to
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.

fj401971
February 9th, 2013, 04:50 PM
I believe it is:


scp -P 2222 file1 username@192.168.0.4:/home/username/file1

With a capital P

sudodus
February 9th, 2013, 04:53 PM
Hi

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

If I try to
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

gazza7
February 9th, 2013, 05:15 PM
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.