All I want to do is move a file from my laptop to my server. Both machines have openssh-server installed, and port 2222 is specified in both sshd_config files as well as both ssh_config files. I'm using the following to attempt to copy the file:
scp -P 2222 user1@thenameofmylaptop:file.name user2@[serverIPaddress]:/home/user2/filepath/file.name
Even though I have password authentication set to no and rsa keys installed in both directions, it still asks me for a password. After I give it the password, it gives me the following error:
ssh: connect to host [IP address of server] port 22: Conection refused
Is there a separate config file for scp? What am I missing?