I had the same problem.
Tried everything couldn't fix it, until I checked my ISP Gateway.
I work with a Zyxel gateway from my ISP and because that is far away from where I have another terminal I shoved a old Linksys DD-WRT flashed Router/Repeater in between. My host terminal that was connected to that Linksys was first connected to the Gateway with a DHCP table lock (I ordered the gateway to give the MAC from that terminal the same IP via DHCP). I did this because I first had a NAS server on that mac. Now I moved the terminal to another location and totally forgot the mac ip assignment.
So now i had a WIFI repeater connected to the Gateway, and the computer with the mac assigned was connected to that.
The problem now was that my Gateway thought it was the old NAS whilst it was the other terminal, and assigned the IP to the WIFI repeater, and this was an IP conflict so scp
couldn't find the right location. Which on it's turn resulted in a access denied on scp
. Weird was that everything did work out fine, i could get on the internet, surf, mail, but with scp
it gave an conflict.
Changed it in the Gateway (removed the DHCP table), and assigned another ip to the terminal...
Now scp
command worked as before!
It took me 8 hours to figure it out so I thought to share this little hickup that can really frustrate you freaking butt off...
Greets
Pi @ir