I want to transfer my folder from my local windows machine to the remote server, but it says permission denied as I'm placing files at root directory, and it have all the permissions
First I place this command ssh root@IP then it says enter you password I entered my password and then I run this command scp -r d:\kbt root@IP:/var/www/html/ But then it ask for the password and then it says permission denied Please help me if anyone can.enter image description here
The issue here is starting the
sshsession first. So when you are runningscpit's executing on the destination machine. It's interpretingd:\test.txtin the same way it interprets162.246.22.217:/var/www/html- It thinks thedbit before the colon is the machine name. You can see that because it asks forroot@d's passwordWhat you need to do is:
sshD:because of howscpinterprets that colon.Try this from your Windows command shell:
The
pushdputs the current working directory on the right Windows drive so you can just use the path from the root of that drive, without needing the colon.Once the
scpcommand above has completed, you can use thesshcommand to check that they're there where they should be.I'd be a bit concerned about 69 failed login attempts. Unless you know it was you.
Edit: some older versions of Windows don't include
scp- You can usepscpfrom Putty very similarly.