pscp between linux and windows - linux

I am trying to scp file(s) from window to linux.
user is windows system, we are executing pscp from linux command
Command used :
pscp user#ip:source dest
It shows :
unable to identify source: permission denied
If I use it in this way,
pscp source user#ip:dest
It works fine and copy the files to windows.
Am I using correct format?
We need to copy from remote windows, but the commands needs to be invoked from local linux system.

Here is an example of how I copy a file from my windows machine to my linux machine
C:\Users...\Downloads>pscp -i "DEV_IRM.ppk"
product-sp-4.2.0-rc2.tar.gz
prvclouduser#10.149.137.26:/home/prvclouduser/sp420
Make sure that you are in the directory where the file you want to copy is located. In my case 'Downloads' directory.
Private key for access: DEV_IRM.ppk
My linux server: prvclouduser#10.149.137.26
The landing directory in linux: /home/prvclouduser/sp420 (make sure this exists; do pwd to confirm full path)

Related

How to access `/.ssh` directory in windows?

I have followed the instructions here using OpenSSH in Windows 10 and created an ssh key stored in this directory: C:\Users\MyUser/.ssh/id_rsa ,as the message I get says.
How do I actually find this directory from the windows cmd (or file explorer) so I can get my ssh key pair?
When I try to cd there I get an error that the directory does not exist.

How to navigate to a file inside a directory via Linux command prompt

Please, I have been trying to navigate to a txt extension file inside a directory via Linux command prompt, but it shows "The directory name is invalid."
C:\Users\GACHIO\wamp\www\Project\etc\nail.txt
That's a windows Directory path. On a Linux OS the root of the file system will not start with "C:\".
Do you have the Windows file system (disk) mounted already within your Linux OS? If so you will need to use the Linux mount point as the start of your quest. I believe Ubuntu will automatically attempt to mount the HDD nowadays under the /media/"username"/"diskname" path
EX. (Ubuntu) to list the file
ls /media/bob/windows/Users/GACHIO/wamp/www/Project/etc/nail.txt
EX. to view the file contents
less /media/bob/windows/Users/GACHIO/wamp/www/Project/etc/nail.txt

Can not copy files From Azure VM to local Windows

I want to copy file from Azure Linux VM to local Windows PC. Actually I remember, I could do this perfectly with the same command but now when I run the cmd it shows message as 100% done but when I go to tmp directory, I dont see the file there.
Here is the cmd I give on Linux VM:
scp -r mlopenedx#138.91.116.170:/edx/var/log/tracking/tracking.log /tmp/
And this is output I get:
tracking.log 100% 70KB 70.0KB/s 00:00
But when I see tmp folder I dont see the file.Can any on suggest me the answer.
I have tried things like: giving Home folder ~/ instead of /tmp/.
Also tried below cmd:
sudo scp -i ~/.ssh/id_rsa mlopenedx#MillionEdx:/edx/var/log/tracking/tracking.log /tmp/
The easiest way to do this is to run pscp from windows like this:
pscp mlopenedx#LINUXVMIP:/edx/var/log/tracking/tracking.log c:/someExistingFolder/tracking.log
to have pscp command you need to install PuTTY.
your command looks wrong as one of the paths needs to be Windows valid path C:/Folder/Folder/File.ext. If you are executing that command from Linux VM and 138.91.116.170 is your Linux vm IP address than you are copping files locally - you can try finding your log file on that linux in \tmp\ folder. In order for that to work from remote Linux to local Windows you would need public IP for your windows or some sort of tunnel that would allow this connection.
Also you are adding -r recursive copy and you are pointing to file.

Blank SSHFS mount folder

I am attempting to mount a remote directory located on my web server to a directory in my xUbuntu installedation hosted in a VirtualBox.
I'm using the following command syntax:
sshfs root#*.*.*.*:/var/www Desktop/RemoteMount
Using the file manager, I navigate to the Desktop/RemoteMount directory but find it entirely blank. The SSHFS command above executed with no indication of an error.
Completely by chance, I use the terminal to long list the contents of the Desktop/RemoteMount directory and it shows all the data I was expecting to see in the file manager.
Can anyone tell me why the file manager does not show my remotely mounted data and how I might fix it?
Thanks.
you are missing local mountpoint.
sshfs -o idmap=user mika#192.168.1.2:/home/mika/remotepoint /home/mika/localmountpoint.
And You need to have localmount folder exist.
thanks Mika

Using putty to scp from windows to Linux

I'm trying to test some C code that I'm writing. The only issue is that the code needs to be executed on a remote machine.
My laptop is pretty old, and there is no driver for my wireless card available for Ubuntu, so booting into Linux to circumvent this problem isn't an option.
Here's my question:
I'm using putty to SSH into the remote machine, and I'm writing my code on Notepad++.
The location of my file is:
C:\Users\Admin\Desktop\WMU\5260\A2.c
My problem is that when I use the command scp C:\Users\Admin\Desktop\WMU\5260\A2.c ~
I get the error could not resolve hostname C:. Name or service not known".
I've also tried scp Users\Admin\Desktop\WMU\5260\A2.c ~ which gives me the error Cannot stat 'Users\Admin\Desktop\WMU\5260\A2.c': no such file or directory
What am I doing incorrectly?
You need to tell scp where to send the file. In your command that is not working:
scp C:\Users\Admin\Desktop\WMU\5260\A2.c ~
You have not mentioned a remote server. scp uses : to delimit the host and path, so it thinks you have asked it to download a file at the path \Users\Admin\Desktop\WMU\5260\A2.c from the host C to your local home directory.
The correct upload command, based on your comments, should be something like:
C:\> pscp C:\Users\Admin\Desktop\WMU\5260\A2.c ckg8221#thor.cs.wmich.edu:
If you are running the command from your home directory, you can use a relative path:
C:\Users\Admin> pscp Desktop\WMU\5260\A2.c ckg8221#thor.cs.wmich.edu:
You can also mention the directory where you want to this folder to be downloaded to at the remote server. i.e by just adding a path to the folder as below:
C:/> pscp C:\Users\Admin\Desktop\WMU\5260\A2.c ckg8221#thor.cs.wmich.edu:/home/path_to_the_folder/
You can use PSCP to copy files from Windows to Linux.
Download PSCP from putty.org
Open cmd in the directory with pscp.exe file
Type command pscp source_file user#host:destination_file
Ex.
pscp sample.txt myuser#myhost.com:/mydata/sample.txt
Reference
Use scp priv_key.pem source user#host:target if you need to connect using a private key.
or if using pscp then use pscp -i priv_key.ppk source user#host:target

Resources