freeSSHD cannot be accessed by scp - scp

I am running freeSSHD on Windows A, and need to transfer file with it by scp. The Windows running freesshd can be connected via ssh client. but neither WinSCP on Windows nor scp on Linux cannot connect to the Windows with freeSSHD. The errors are:
on Linux:
test#workstation:~$ scp -r /home/test/scptest test#192.168.91.238:/C:\Users\dejavu\Desktop
test#192.168.91.238's password:
exec request failed on channel 0
lost connection
on windows:
'scp' protocol is selected to transfer file and the port is default 22.
The error is simply host is not communicating for more than 15 seconds. still waiting...

scp, as many other things, is two-side protocol. It requires scp to be present on both client and server. When you issue copy command, ssh connects to given server and spawns scp process, which your local scp then communicates with. In your case, there is no scp on server, so no communication possible.
rsync behaves in exactly the same way.
I guess in your case you could try sftp.

Related

Is there a way to make an SFTP connection to a remote machine through jump server to transfer files?

I was wondering if there's a way to send files using SFTP to a remote machine through a jump server.
As you can see in the image below first it's needed an SSH connection and after that an SFTP connection.
My main problem here comes after the SSH connection, my workspace has changed and I cannot retrieve the necessary files to execute the SFTP successfully.
I've tried the following code:
ssh jump-server-user#ip-jump-server 'echo "put /source/files /remote/files" | sftp -v remote-machine-user#ip-remote-machine'
But it does not work.
I've tried to execute a simple command like pwd using the SFTP connection and it works so I think the problem here is how the workspace change.
There would probably be an easier solution but I cannot use SSH on the jump server-remote machine connection and I cannot store the local files in the jump server to send them later to the remote machine.
If you have a recent OpenSSH (at least 8.0) locally, you can use the -J (jump) switch:
sftp -J jump-server-user#ip-jump-server remote-machine-user#ip-remote-machine
With older version (but at least 7.3), you can use ProxyJump directive:
sftp -o ProxyJump=jump-server-user#ip-jump-server remote-machine-user#ip-remote-machine
There are other options like ProxyCommand or port forwarding, which you can use on even older versions of OpenSSH. These are covered in Does OpenSSH support multihop login?

SCP times out, but ssh connection works fine. Am I doing something wrong?

I'm trying to copy task1.zip from my desktop /Users/myname/desktop if I pwd, to a remote server. I'm connected to the remote server via ssh. I would like to copy the file to /its/home/jt463/task1(pwd path from the directory) on the remote server.
I have used the command below in the terminal when I'm connected to the server via ssh and tried it on the terminal on my machine:
scp Users/myname/desktop/task1.zip username#inf900179.inf.susx.ac.uk:its/home/username/task1
Error that I get when I try to use the terminal that's connected to the remote server:
Users/jonatantibarovsky/desktop/task1.zip: No such file or directory
Error that I get when I try to use my local terminal:
ssh: connect to host inf900179.inf.susx.ac.uk port 22: Operation timed out lost connection
First scp to the intermediate server, using your credentials. Then, you should be able to scp from that server to the target.

How to copy file from Windows to Linux machine through command line?

I am trying to copy a file which is present in my local machine - which is Windows 10.
And I have connected to Linux server from my PC through VNCViewer.
Now I need to write a shell script on my server to copy file from my windows machine to that linux server.
So I am using scp command to do this.
scp username#ip_addr:/Users/username/eclipse-workspace/project/file.c
/root/username/some_folder_path/
But when i try to do this, I get the error like-
ssh: connect to host ip_addr port 22: Connection refused
I guess SSH is not running on the windows, that would be the reason for this error.
Is this the write way to do it or is there a better way to achieve this?
Open a windows terminal and connect to your linux server with sftp
sftp username#linuxIP
then you can browse inside your linux server using commands cd ls etc. From that terminal you can also use lcd lls to move (or show files) inside your local machine (windows 10 in your case). You can get files by typing get <filename> and send items with put <filename>

could not resolve hostname with scp

I am accessing an ubuntu server over ssh with putty on my windows machine and trying to download a single file to my local windows machine
my windows username is Mark and my hostname per cmd is Marks I am trying the following command on the remote server
scp backup.sql mark#marks:desktop
and I get could not resolve hostname I have tried to put in what I think myip address is and the connection times out
The syntax is this, relative to where you're issuing the command:
scp user#host_from:location/file user#host_to:location/file
And of course if you're local you can omit the user#host prefixes:
scp local_file me#host_to:~/local_file
The direction is always from > to relative to where you issue the command.
binarysubstrate is right about the syntax. The problem is, if the OP puts the name (or address) of his windows client in the 'to' part of the scp command, it probably won't work for a number of reasons:
his windows machine may not have a resolvable FQDN,
his windows machine may be behind a NAT firewall that is not setup to port-forward SSH requests,
he probably does not have an SSH daemon running on his windows machine.
To simply copy a file from the remote server down to a windows client, I would recommend WinSCP.
From the ser you ping your machine name ? Try replace machine name for the IP Address, or add your machine name to hosts configuration file from the server.

Open MPI can't launch remote nodes via SSH

I am trying to set up Open MPI between a few machines on out network.
Open MPI works fine locally, but I just can't get it to work on a remote node.
I can ssh into the remote machine (without password) just fine, but if I try something like
mpiexec -n 4 --host remote.host hello_c
then the ssh connection just times out.
I checked several tutorials but the only configuration instructions they give is "make sure you can ssh into the remote machine without a password". I did and I still can't launch nodes on remote machines. What's the problem?
I've the same issue. Try to connect in ssh with rsa certificates
Edit 03/24 : This not work.. sorry