Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm using openssh server on my linux laptop and openssh client on my windows desktop. I'm on my windows desktop using ssh to get into my laptop.
A google search tells me I should be able to copy file from my laptop to my desktop with:
I use sftp to copy from the server to the client. I also use WinSCP rather than the command line, but I think you’d connect with sftp (which uses ssh) then do an meet to pull multiple files down.
That said, the error would indicate a syntax issue with your command to me...I’d think the connection info should be first...check the man page.
You syntax does not appear to be correct. I don't use widows scp client and therefore do not know how its syntax differs from the linux version but try:
Just to further clarify
I'm on my windows desktop ssh'ing into my linux laptop, and while I'm in there, I'm trying to scp to transfer files
back to my windows desktop.
Just to further clarify
I'm on my windows desktop ssh'ing into my linux laptop, and while I'm in there, I'm trying to scp to transfer files
back to my windows desktop.
We don’t know how to help when you say “didn’t work”. What error did you get?
I’m gonna repeat this: Get and use WinSCP to sftp to/from Windows... it’s free, it runs over the PuTTY engine...click and drag or double click from it’s UI.
Sorry I over looked that in your first post and misread the title. To transfer files back you need a sftp server running on the Windows desktop computer. Did you install a server on the Windows desktop?
As suggested use a GUI file transfer utility like filezilla or WinSCP do download your files from the linux laptop.
I'm using openssh server on my linux laptop and openssh client on my windows desktop. I'm on my windows desktop using ssh to get into my laptop.
A google search tells me I should be able to copy file from my laptop to my desktop with:
This command attempts to copy local directory ~/Documents/Python and Chris’ home directory on host 192.168.0.10 to the directory \LaptopBackup on a remote system named D. Not your intention, I guess.
but you have to tell the scp client that the colon after the D is part of a local name and doesn’t separate the remote host name from the remote directory. I am sure there is an option for this, but I will leave it up to you to read the scp manual.
Last edited by berndbausch; 05-19-2019 at 09:55 PM.
But, your actual command syntax still looks suspect to me if I correctly understand the direction.
So, based on your original post, and this...
Quote:
Originally Posted by Chrislw324
I tried that, but it didn't work either.
Just to further clarify
I'm on my windows desktop ssh'ing into my linux laptop, and while I'm in there, I'm trying to scp to transfer files
back to my windows desktop.
The scp command you show is being issued ON your Linux machine while logged in via SSH from elsewhere - meaning in a shell on the Linux machine:
So you want to copy file(s) from ~/Documents/Python to the other machine at Chris@192.168.0.10, and put the files into D:\LaptopBackup on that machine.
If so, then from here I find the syntax should be:
I even messed up the command syntax in my previous post. Its always source first then destination. The OP wants to transfer files from the linux laptop to the Windows desktop.
astrogeek posted the correct syntax but as far as I know I don't think you can use a scp client on a Windows sftp server...
I'm using openssh server on my linux laptop and openssh client on my windows desktop. I'm on my windows desktop using ssh to get into my laptop.
A google search tells me I should be able to copy file from my laptop to my desktop with:
ssh: Could not resolve hostname d: name or service not known
lost connection
Why is this not working?
Server serves the clients, but here you want to the client to serve, which will NOT work. Either your Google search string was wrong or you understood incorrectly.
You CAN connect from your Windows desktop (which is the client) to your Linux laptop (your server).
To do that, download Putty Tools (pscp is the file) to your Windows desktop. Then:
In above command, you are using pscp to connect to you linux laptop as "linuxuser" to copy from "linuxuser"'s /Documents/Python directory to D:\LaptopBackup on your desktop. The "-r" is for recursive copy...
Just to further clarify
I'm on my windows desktop ssh'ing into my linux laptop, and while I'm in there, I'm trying to scp to transfer files
back to my windows desktop.
This won't work. Especially the last part. Running scp on the linux laptop would require your windows pc to be an ssh server... which it is not.
As was pointed out multiple times, use an sftp/scp client on windows. Filezilla or winscp come to mind. You can not solve this problem with putty alone unless you install an ssh server on your windows machine. You don't want to do this.
SSH on windows is clumsy at best. Get over it and install the tools (i.e. filezilla or winscp) to workaround said shortcomings.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.