scp upload file: no such file or directory - windows

I'm using ssh to connect with a linux server. I'm trying to upload a file from my own computer(windows7) to linux.
When I type scp Desktop/H5.txt xxUserNamexx#mumble-39.xxServerNamexxx:/u/private/
I got following error:
scp Desktop/H5.txt xxUserNamexx#mumble-39.xxxServerNamexxxx:/u/private/
Desktop/H5.txt: No such file or directory
I can guarantee the server name and the file directory is correct. It seems that scp cannot find my file on my local computer.
What's the default path? What path should I type if the file I'm intending to upload is on my desktop?
Thank you

winscp is a nice option to copy files from MS to *nix. Also pscp is useful. SCP have known issues when used between MS and nix. There seems to be some misunderstanding of folder structure by scp.

drap the H5.txt from desktop to you cmd windows, this can avoid you type the wrong path

In the future you could try using winscp when you're dealing with small files. Also I think a cygwin scp should work just fine.

The slashes are incorrect. On Windows, it should be (assuming you are running Command Prompt from your Home directory):
C:\Users\user> scp Desktop\H5.txt junjue#mumble-39.xxServerNamexxx:/u/j/u/junjue/private/

Related

SCP says file has downloaded, but the file does not appear

I am using ssh to work on a remote server, however when I try to download a file using scp in this format:
scp name#website.com:somefile.zip ~/Desktop
It asks me for my password, and shows this:
somefile.zip 100% 6491 6.3KB/s 00:00
however, this file never appears on my desktop. Any help
I think that you are logging into the remote machine using ssh and then running the command on the remote machine. You should actually be running the command without logging into your remote server first.
You need to specify the file path
scp name#website.com:/path/to/somefile.zip ~/Desktop
~/Desktop should actually be a directory, not a file. I suggest that you do the following:
Remove the ~/Desktop file with rm ~/Desktop (or move it with mv if you want to keep its contents).
Create the directory with mkdir ~/Desktop.
Try again to scp the zip file.
BTW, when I need to copy files into directories, I usually put a slash after the directory to avoid such problems (in case I make a mistake), e.g. scp server:file ~/Desktop/; if the directory doesn't exist, I get an error instead of unwanted file creation.
You are doing this from a command line, and you have a working directory for that command line (on your local machine), this is the directory that your file will be downloaded to. The final argument in your command is only what you want the name of the file to be. So, first, change directory to where you want the file to land. I'm doing this from git bash on a Windows machine, so it looks like this:
cd C:\Users\myUserName\Downloads
Now that I have my working directory where I want the file to go:
scp -i 'c:\Users\myUserName\.ssh\AWSkeyfile.pem' ec2-user#xx.xxx.xxx.xxx:/home/ec2-user/IwantThisFile.tar IgotThisFile.tar
Or, in your case, (that is with the VERY strong password you must be using):
cd ~/Desktop
scp name#website.com:/path/to/somefile.zip somefile.zip

Copy files from authenticated windows server to Unix server

I have a set of zip files that need to be copied from an authenticated windows server to a unix server which is authenticated too.
I have tried using Pentaho but have not found any success. Is there any other alternative way with which this copy can be done like using scripts or any such method?
Thanks in advance.
Assuming your server supports ssh..
Putty comes with a utility called pscp which works the same as scp.
To copy a file you would typically do this:
pscp myfile.zip me#myserver:/my_directory/.
There is also winscp if you want something more GUI.
Use scp command. For more detail visit http://www.garron.me/en/linux/scp-linux-mac-command-windows-copy-files-over-ssh.html

In FTP, how do I copy a remote file to other directories

Using FTP commands I want to upload a large file once and then copy that file to many directories on the remote FTP server. All the copy commands seems to relate to copying from local to remote or the other way around.
Is there an FTP command to copy remote to remote?
are you trying to move the file? if yes, you can do it using rename command to move the file, as for copy i guess you still have to do the the get,send from local-remote way.
as for move command should be something like this
rename /oldpath/file2move.txt /newpath/file2move.txt
Basically just rename your file path that is infront of the file that you wish to move.
As far as I know, there is no such command available in FTP protocol. There are some extensions to SFTP protocol to do this (and, having SSH access, you can issue cp commands), but SFTP is not an FTP.

rsync to copy folders local and remote

I'm trying to copy a directory with files and folders to another directory, first locally to test, and then to a remote server. The tool that I must use is rsync, but after a lot of testing and reading the docs I can't make it work under Windows 7.
For example, when I try
rsync -av D:\source\ D:\dest\
I get the error The source and destination cannot both be remote.
When I try rysnc -av \source\ D:\dest\, I get Error: Failed to exec ssh: No such file or directory (2)
Do you know how can I get it to work?
Thank you.
Cygwin paths are different, to make them Unix-like. Use
rsync -av /cygdrive/d/source/ /cygdrive/d/dest/
D: is interpreted as a remote server called D
Gravedigger coming back to dig this up -
On my windows 8.1 machine it was running everything fine but5 on my Windows 7 machine I was having this same issue. Fixed it by editing vagrant's source -
For me it was here - C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.3\plugins\synced_folders\rsync\helper.rb
And I added cygdrive as a prefix and everything is going well -
if Vagrant::Util::Platform.windows?
# rsync for Windows expects cygwin style paths, always.
# Editing source is never fun, but it works : /
hostpath = "/cygdrive" + Vagrant::Util::Platform.cygwin_path(hostpath)
end

Is there a way of listing the contents of the local directory in ftp?

lcd changes local directories.
ls lists files on remote directory.
What I would like is lls, to list files on local directory.
Is this possible?
I know I can always open another terminal to do this, but I'm lazy!
Yes:
!dir
The ! tells the client to run a local shell command. Tested this using both the Windows and Fedora default ftp clients. Note that the actual command may depend upon your OS, for example !ls may be necessary on other versions of Unix/Linux.
For what it's worth, the ! command is listed in the ftp client's help system:
ftp> help !
! escape to the shell
To list files locally use following command
!dir
Or use following command
!ls
Note: ! means locally not the remote.
lcd is working but !cd will not work and lpwd is not working but !pwd is working.

Resources