Get all supported KexAlgorithms of an sftp server - node.js

I try to connect with an sftp server using the nodejs package https://github.com/mscdex/ssh2.
In the section "serverHostKey" they list all available host key formats.
I try to connect with a new server, but no matter which format I choose, I cant establish a connection because the format/algorithm is not supported.
Is there a way - a command for the command line - , to see which formats/algorithms a certain server supports?
I already tried WINSCP (shows me only the format WINSCP uses), Putty (same as WINSCP)-

https://superuser.com/questions/868998/how-can-i-find-a-list-of-macs-ciphers-and-kexalgorithms-that-my-openssh-client
The second answer of this question, is the answer of my problem.
ssh USER#HOST -p PORT

Related

sublime text sftp tunnel wbond

To work remotely I need to SSH into the main server and then again into the departmental server.
I would like to set up a tunnel using sublime text 3 wbond sftp package to view and edit files remotely but I can't seem to find any information for setting up a tunnel. Is this even possible?
The reason I'm interested in this particular package is because I am unable to install any packages locally on the server, hence using something like rsub is not possible.
Any other suggestions besides sublime sftp are welcome.
I'm not sure the SFTP plugin would allow to do this directly.
What i would suggest is for you to use ssh -L to create a tunnel.
ssh -L localhost:random_unused_port:target_server:22 username_for_middle_server#middle_server -nNT
Use the password/identity_file for the middle server
The -nNT is to avoid opening an interactive shell in the middle server.
IMPORTANT: You need to keep the ssh -L command running so keep that shell open.
In this way you can connect to the target_server as such:
ssh username_for_target_server#localhost -p random_port_you_allocated
Similarly you can setup the SFTP plugin file as such
{
...
"host":"localhost",
"user":"username_for_target_server",
"ssh_key_file": "path_to_target_server_key",
"port":"random_port_you_allocated",
....
}
As a sidenote, always use the same port to tunnel to the same server, otherwise, with the default ssh configuration, you will be warned of a "Man in the middle attack" because the signature saved in the .ssh/known_hosts will not match with the previous one. This can be avoided by disabling this feature but I wouldn't recommend it.

Sending .csv file from linux to windows

I want to send files (txt or csv) from linux to windows.
I already have a script to get information and put it into a .txt or .csv file, tried with many ways to send this file from linux to my computer.
there is a ping from server to my computer IP, but when i use below commands it gives:
ssh: connect to host 10.10.X.X port 22: Connection timed out
scp -r fname.lname#10.10.X.X:/home/ test.txt
or
scp test.txt fname.lname#10.10.X.X:/C:/Data
Please could you help, simply I wanna have a copy of file (that I have it in server) in my computer, to use it.
there is some similar questions with no answer here.
You need a ssh server installed on windows. Windows does not currently have out of the box ssh server. They are thinking of implementing OOB ssh servers in future releases of windows 10.
Have a look at this link https://winscp.net/eng/docs/guide_windows_openssh_server
Also, if the file transfer that you want is a one time transfer, you can use putty with a reverse scp to retrieve the file or you can use WINscp ( https://winscp.net/eng/download.php )
I usually use the command 'nc' for file transmission.
But since on Windows you have to install a cygwin to use nc, so I think the simplest solution may be like the following.
On linux, go to the directory of those files, and then type:
python -m SimpleHTTPServer 1234
Then on windows you can visit 10.10.X.X:1234 in your browser, and download those files.
Note that 1234 can be replaced by any other port which is not currently used on linux.

Rsync from Linux to Windows SFTP Server

I'm trying to sync documents to an Windows SFTP server via RSYNC on a Linux Machine.
This is my command
rsync -e ssh /home/antony/Documents/Test user1#172.20.1.18:Test
This is the error
exec request failed on channel 0
rsync connection unexpectedly closed (0 bytes recieved so far)[sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.0]
The above may happen for several different reasons.
Maybe the SSH subsystem of rsync is refusing the server key, but this is unlikely because from your description seems like the server is "cutting" the connection, not the client.
Another possibility is that there is no SSH/SFTP server listening on the default port on 172.20.1.18
Or maybe password authentication is not enabled on the server, and you need to authenticate via PKI using a key that you (on the client side) do not have...
In any case, the best thing to do is to double check with the administrator who has configured the server side.

SSH Secure Shell Tunnel X11 - Display not shown

I am using SSH Secure Shell to connect to a server. My connection is allowed to Tunnel X11 connections but when I execute the command. The display is not showing up. I get the message:
couldn't connect to display "localhost:12.0"
I have a ssh server installed and running on my machine.
Remember: Both the client and the server have to allow X forwarding.
On the server look in /etc/ssh/sshd_config and make sure you have X11Forwarding yes. You will need to restart the service if you edit this file.
On the client look in /etc/ssh/ssh_config (your user ~/.ssh/ssh/config will override global settings, if you have created this file) and make sure you have ForwardX11 yes.
Alternatively give the -X switch when you create your client connection. e.g. ssh -X user#host
Oh and of course, your client needs to be running an X server which you have authority to use! E.g. if you connect from Windows using PuTTY it will never work, as Windows is not an X server!
I figured it out. I needed to have X-Server installed on my computer instead of SSH-Server. I installed Xming for that purpose and now everything works as it should.

ftp: Name or Service not known

in command line
> ftp ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/
Work on one computer but does not work on my other one. Error returned
ftp: ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/: Name or service not known
I also tried the raw IP address which is
> ftp ftp://130.14.250.10/1000genomes/ftp/data/
But it didn't work.
What is the problem here? how can I fix this?
The ftp command accepts the server name, not a URL. Your session likely should look like:
ftp ftp-trace.ncbi.nih.gov
(Server asks for login and password)
cd /1000genomes/ftp/data/
mget *
This depends on the ftp client you are using. On Mac OSX (ftp client from BSD), for example, the default command line ftp client accepts the full url, while for example in CentOS the default client doesn't, and you need to connect just to the hostname. So, it depends on the flavor of linux and the installed default ftp client.
Default ftp client in CentOS (ARPANET):
ftp ftp-trace.ncbi.nih.gov
cd 1000genomes/ftp/data
If you want to use the full url in CentOS 5.9 or Fedora 18 (where I tested it), you could install an additional ftp client. For example ncftp and lftp have the behavior you are looking for.
ncftp, available through yum or your favorite package manager:
ncftp ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/
NcFTP 3.2.2 (Aug 18, 2008) by Mike Gleason (http://www.NcFTP.com/contact/).
Connecting to ...
...
Logged in to ftp-trace.ncbi.nih.gov.
Current remote directory is /1000genomes/ftp/data
lftp, also available through your favorite package manager:
lftp ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/
cd ok, cwd=/1000genomes/ftp/data
lftp ftp-trace.ncbi.nih.gov:/1000genomes/ftp/data>
Another, more efficient, way to retrieve a page, is using wget or curl. These work for http, ftp and other protocols.
It looks to me like the computer that isn't working is already adding the ftp: to the URL, have you tried removing it from yours and seeing if that works?
> ftp ftp-trace.ncbi.nih.gov/1000genomes/ftp/data

Resources