Question

I am currently connected to a windows server. I installed winscp on it. I run the winscp and connect to a linux server. Now on the gui of the winscp, i clicked the console, and use the scp command. the file on the remote server is C:\xampp\htdocs\android\files\file.txt now i want to transfer it to my linux server. Im planning to automate this using an application like python. but the problem is my code is incorrect. to be honest i dont really get it. so please guide me.

here is what im trying to do.

scp C:\xampp\htdocs\android\files\file.txt remote_server_ip_add@linux_ip_add:/home

i dont know if this is correct. it's just not working.

the username of the remoteserver for example is "Remote_server". and the user name of the linux server for example is "linux_Server".

should it be like this?

scp C:\xampp\htdocs\android\files\file.txt remote_server@linux_server:/home

i also got this error

C: node name or service name not known
Was it helpful?

Solution

Syntax is

scp local_file remote_login@remote_server:/remote/path

And you're swapping terms. In your case, remote is a linux machine. For winscp, windows would be local.

Then, if it will be able to connect to specified server, it will use your certificate to authenticate and, if fails, ask for specified user's password.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top