ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Personally I would use 'scp', but as you are using Putty I would not know how to deal with the local (Windows?) end of things. I'm assuming Windows as I can't see any reason to run Putty if you have an ordinary *nix shell available. With that in mind take a look at WinSCP for doing drag/drop type copies between Win/Lin over a network.
Personally I would use 'scp', but as you are using Putty I would not know how to deal with the local (Windows?) end of things. I'm assuming Windows as I can't see any reason to run Putty if you have an ordinary *nix shell available. With that in mind take a look at WinSCP for doing drag/drop type copies between Win/Lin over a network.
Hope that helps.
if you are using putty , you just get a command console ....this is just as similar you fire a telnet command from windows command prompt.
What I need is a proper FTP command to shoot from the remote console .
After this, to copy/move this file from server to your local hard disk, you can use winscp on your Windows and browse both local and remote directories.
Keep in mind when you are logged in with Putty, you are on a *remote* system. Put it this way, if you were sat at a Linux server in one place, how would that server access your windows box from that server? Could you ftp into it from that Linux box? Does the windows machine have an ftp server running on it? Does it have a scp service running on it? Probably not.
pscp is available in the full PuTTY package that I use. But, there is no graphical interface so you have to run it from the command line (as Dave_Devnull) stated. scp (pscp in this case) is built into ssh and connects through the ssh daemon on the server. So, you need no other programs to do this. This, to me, would be the best way.
It brings us back to what Putty itself is. It's a remote client. So the OP needs to ask himself "If I was sat in front of that Linux server, how could I access that Windows machine?"
The command to run if the OP wants to do it from a Windows command prompt;
1. cd into the directory where 'pscp.exe' is located (of not in the path) - in my example it's in C:\putty
2. Run:
Where user1 is the username used to log into the remote server
1.2.3.4 is the ip address or hostname of the remote server
This will prompt for the remote server's password for 'user1', and the file will then download into the current directory on the Windows box (signified by the '.' on the end of the statement)
It brings us back to what Putty itself is. It's a remote client. So the OP needs to ask himself "If I was sat in front of that Linux server, how could I access that Windows machine?"
The command to run if the OP wants to do it from a Windows command prompt;
1. cd into the directory where 'pscp.exe' is located (of not in the path) - in my example it's in C:\putty
2. Run:
don't we need to use port number here ? In putty when I login i normally choose port = 22 and SSH ...Don't we need to write down port number in your command ?
Where user1 is the username used to log into the remote server
1.2.3.4 is the ip address or hostname of the remote server
This will prompt for the remote server's password for 'user1', and the file will then download into the current directory on the Windows box (signified by the '.' on the end of the statement)
C:\putty>dir
but I wanted to send it to the D:\YourInside\pages folder . so, this seems I need to copy manually again to my desired directory ...can't I downloadload the file directly to the destination folder ?
No port reqd, scp is part of the ssh pkg and assumes port 22 unless otherwise directed.
K.I.S.S.
This works if the file is NOT present in local hard disk.
but If the file is present in local hard disk then it throws an error ' Cannot create file' ...So, can you modify the command so that it can include overwrite file download ? is it possible ? it may ask 'Y' or 'N' for overwrite .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.