push file to remote system through telent using ruby - ruby

I have a remote embedded system which it is telnet-able. How can I download a binary file from the host to it? I can read file from the system, but have no idea how to write to it.

you probably want to do this with ftp
If there is no ftp server on the target system try using kermit

Related

Ftp saying `R:ICMP port unreachable` with special chars in file name when ftping to Windows

I am trying to transport a file from a Linux server to a Windows server using a cron job to kick off an ftp request. If the file is named archive-2015-11-11-2.tar.gz the ftp works great, however, when I copy this file under the name archive-2015-11-12-00:00:01.tar.gz and try to ftp from my Windows box I get the error > R:ICMP port unreachable. Is there a way I can transfer the file without renaming? I tried both get and mget but neither works.
Env
OS: Windows
Terminal: Cygwin
Colon is not a valid character in a Windows file spec. The error message may be misleading but if you're trying to create a file named archive-2015-11-12-00:00:01.tar.gz on a Windows box that will not work.

obtain a full remote file size from a running remote process using command line tools

I need to get the filesize of a remote executable file which its process is running on a remote xp machine.
it must be done from a Windows system using only a batch file and only from a command line.
sigcheck.exe cannot be used because it does not take control over remote files.
I can not even map the remote disk to do that.
Hope someone have a good solution.
thanks in advance.

How to download a file from my server using SSH (using PuTTY on Windows)

When I try downloading a file from my server onto my computer, it actually downloads the file onto the server.
(Note I am already SSH'd into my server before typing this command. I've watched tutorials on YouTube and people are using their terminal without SSHing into any particular server, however I don't think I can do this with PuTTY on Windows?)
scp -r -P2222 kwazy#mywebsite.example:/home2/kwazy/www/utrecht-connected.nl ~/Desktop/
The problem is that I am specifying the location to download the file as only ~/Desktop/
This creates a folder called Desktop in my server, instead of copying the files onto my local desktop.
I am able to use this command on Linux.
I have successfully download the folder onto my desktop:
I still need insight onto how I can do this on a Windows machine.
There's no way to initiate a file transfer back to/from local Windows from a SSH session opened in PuTTY window.
Though PuTTY supports connection-sharing.
While you still need to run a compatible file transfer client (pscp or psftp), no new login is required, it automatically (if enabled) makes use of an existing PuTTY session.
To enable the sharing see:
Sharing an SSH connection between PuTTY tools.
Even without connection-sharing, you can still use the psftp or pscp from Windows command line.
See How to use PSCP to copy file from Unix machine to Windows machine ...?
Note that the scp is OpenSSH program. It's primarily *nix program, but you can run it via Windows Subsystem for Linux or get a Windows build from Win32-OpenSSH (it is already built-in in the recent versions of Windows 10 and in Windows 11).
If you really want to download the files to a local desktop, you have to specify a target path as %USERPROFILE%\Desktop (what typically resolves to a path like C:\Users\username\Desktop).
Alternative way is to use WinSCP, a GUI SFTP/SCP client. While you browse the remote site, you can anytime open SSH terminal to the same site using Open in PuTTY command.
See Opening Session in PuTTY.
With an additional setup, you can even make PuTTY automatically navigate to the same directory you are browsing with WinSCP.
See Opening PuTTY in the same directory.
(I'm the author of WinSCP)
try this scp -r -P2222 kwazy#mywebsite.example:/home2/kwazy/www/utrecht-connected.nl /Desktop
Another easier option if you're going to be pulling files left and right is to just use an SFTP client like WinSCP. Then you're not typing out 100 characters every time you want to pull something, just drag and drop.
Just noticed /Desktop probably isn't where you're looking to download the file to. Should be something like C:\Users\you\Desktop
OpenSSH has been added to Windows as of autumn 2018, and is included in Windows 10 and Windows Server 2019.
So you can use it in command prompt or power shell like bellow.
C:\Users\Parsa>scp parsa#192.168.100.11:/etc/cassandra/cassandra.yaml F:\Temporary
parsa#192.168.100.11's password:
cassandra.yaml 100% 66KB 71.3KB/s 00:00
C:\Users\Parsa>
(I know this question is pretty old now but this can be helpful for newcomers to this question)
if you install git with git bash, you get SCP available on windows.
You can use WinSCP : https://winscp.net/eng/download.php
Or MobaXterm : https://mobaxterm.mobatek.net/download.html
It feels like FTP client. Also I don't remember setting up anything on my machine for this. It just fresh install and install SSH server (IDK if it matters though).
For MobaXterm :
If your server have a http service you can compress your directory and download the compressed file.
Compress:
tar -zcvf archive-name.tar.gz -C directory-name .
Download throught your browser:
http://the-server-ip/archive-name.tar.gz
If you don't have direct access to the server ip, do a ssh tunnel throught putty, and forward the 80 port in some local port, and you can download the file.
You can use the WinSPC program. Its access to any server is pretty easy. The program gives its guide too. I hope it's helpfull.
If you need something with GUI you can use FileZilla. it support SFTP.
It's perfectly working with ssh and you can even edit files and it will automatically upload the changes.

Send a file to Windows server directory in Oracle Data Integrator

I have a interface which is a database to file Interface.
After processing the records, I put the generated file on a Unix directory path. My requirement is to send the output file to a Windows Server directory instead of Unix in Oracle Data Integrator.
How can I achieve this?
Here are (2) options:
After generating the file on the ODI/Unix server, use an [OdiFtpPut] step to FTP the file to the Windows server
Write a Java app that will reside on the ODI/Unix server, after generating the file, use a an OS Command step to invoke the Java app (using parameters) to perform the file move or FTP

Confusion about FTP

I am learning web development and I'm a bit stuck with FTP. I know it's used for file transfer but how do I actually use it? I found some PHP functions to connect to the FTP server and log in but what do I log in with? How do I create a username? Is FTP something like MySQL with it's own command line? Or is it something like Apache?
I am using Ubuntu 12.04 and I have LAMP installed. I found somewhere that I need to install a program to use FTP but I found somewhere else that I need to install FTP while installing PHP. This is really confusing.
Thanks.
FTP is File Transfer Protocol. It is not a programming language. FTP is used to connect to a computer to access its file system - to upload or download files. Imagine opening a folder on firends pc from you computer. In most linux you can type in a ftp address to the location bar in whatever file browser your using and access the ftp server as if it was a local folder. You can also use specific software for that - gftp, filezilla.
A ftp daemon does not come with lamp. Please refer to https://help.ubuntu.com/12.04/serverguide/ftp-server.html for details on how to install/configure a ftp daemon on ubuntu.
What you will use ftp for is to put your .php files on a remote machine. If you are doing things on your computer only it is likely that you do not need ftp.

Resources