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

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.

Related

ssh tunnel VNC server connection closed unexpectedly

I have to tunnel the VNC server(tightvnc-server) running on my local machine to a remote server, so at remote server can access my local machine without port forwarding on router(at local machine network).
Right now I am using the following command
ssh -R 5950:localhost:5900 user#remote.ddns.net
Where 5900 the vnc server port on my local machine. And I have to access the machine from remote server using the command localhost:5950. And when I try to connect using vnc viewer I am getting the error connection closed unexpectedly. Normally if no connection exist I was getting connection refused error. But here something is missing in tunneling. Can any please tell me what could be the reason.
You need to activate the remote desktop, running:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \ -activate -configure -access -on \ -restart -agent -privs -all
Then you can connected using VNC Viewer

Unable to ping my remote machine using Ansible

I have a remote machine to which I want the connection to be set.
This is my hosts file:
[remote]
192.168.51.2
where 192.168.51.2 is the private ip of the remote machine.
When I try pinging it using ansible remote -m ping, I get the following error:
192.168.51.2 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh.",
"unreachable": true
}
I did not mention the credentials of that remote machine anywhere, but I don't think that's the problem here. It is failing to connect via SSH.
What do I do?
I did not mention the credentials of that remote machine anywhere, but I don't think that's the problem here. It is failing to connect via SSH.
This is the exact cause of your problem.
Ansible does not use a network (ICMP) ping, but a more complex procedure involving logging on to a remote machine via SSH and running Python script to respond.
You must provide the credentials either in the form of the private-public key-pair or a password.
Ansible basics are well documented and available here. The Remote Connection Information section of the Getting Started guide explains the way Ansible connects to remote hosts.
Leave the fingerprint of the master server to the remote server first before pinging to the remote server with ansible.
So "log in & log out the remote server first from the master server. Then, ping to the remote server with ansible."
I also couldn't ping to a remote server so I did the solution above ↑↑↑
Then, I could ping to the remote server.
I don't know what's happening backside but this solution will work.

Dropbear SSH Tunnel disconnected if upload a file

i am newbie here.
I want to create ssh tunnel application,
but i have a problem with my application.
If I trying to upload a file (>500kb) trough that SSH Tunnel, my internet connection getting not responding and after that I'm disconnected from server.
what is the problem? do ssh server have a limit to upload connection?
*I use dropbear for ssh server

freeSSHD cannot be accessed by 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.

shell script for copying from remote server to local computer using ssh tunneling - scp

I have managed to connect to a remote server through ssh tunneling. No how can I copy files from remote server to my local computer. Considering that I just want to do it from remote server to my local computer.
I dont know how to write this command
"scp file/I/want/to/copy localhost/home/folder"
thanks a lot
Example:
scp username#server:/home/username/file_name /home/local-username/file-name
check this:
http://www.garron.me/linux/scp-linux-mac-command-windows-copy-files-over-ssh.html
scp -r (source)hostname:/(location of the file to be copied)/(file name) (Destination)hostname:/(location of the folder where the file should be copied to)
For example:
scp -r ram.desktop.overflow.com:/home/Desktop/Ram/abcd.txt rajesh.desktop.overflow.com:/home/documents/