Find linux command to transfer file over SFTP - linux

Find linux command to transfer file over SFTP. need help with the detailed commands first we were using Filezilla but now we need to use the linux commands to perform this...
Find linux command to transfer file over SFTP. need help with the detailed commands first we were using Filezilla but now we need to use the linux commands to perform this...

You would need to establish a SFTP connection first to transfer files between the servers. (Either using ssh keys or password). Refer the article which explaining the required sftp commands.

Related

alternative for net use in Linux

I am currently working on file transferring system from one server to another one in Linux. I'm still a novice coder and new with Linux. I found that in Window we can actually use net use to connect a server to another server something like:
net use destination_server/user:username password
Is there a way, we can apply the same concept in linux?
Would really appreciate the help, Thanks.
You may use ssh but remote server should have ssh server installed.
example command :
ssh username#destination_server
Other alternatives :
sftp : You may transfer files but it won't provide direct shell access to remote server meaning you can not use all commands available in that server.
scp : one line command to transfer files and folders.

How to regularly send file from Windows to Linux server

I have a simple question. I want my Windows 7 PC to send a file to Linux server every minute. This would be easy to do on Linux via cronjobs but I have really no idea how to do that on Windows.
For example. We have a file called example.txt in c:/programfiles/folder/ on my Windows PC.
I want to send that file to Linux server to folder /home/fold.
Any idea what to use and how? Does Windows have anything similar to
cronjob? What to use instead of scp? Maybe use FTP but my Linux server
only works with explicit TLS and I have no idea how to force ftp
client to send that file in Windows.
Ty in advance and sorry if I ask stupid question.
Windows equivalent to the cron is Windows Task Scheduler.
The Windows ftp.exe client does not support TLS/SSL. It also does not support a passive FTP mode. So you have to use a different client. Once you have to use a different client anyway, you can use SFTP.
So take any scriptable SFTP client (or FTPS or SCP client if your prefer) and schedule it to be run using Windows Scheduler.
For example with WinSCP, you can use a batch-file like:
#echo off
winscp.com /log=winscp.log /command ^
"open sftp://user:password#example.com/" ^
"put c:\path\file.txt /path/" ^
"exit"
(WinSCP supports FTPS and SCP too).
Then, in Windows control panel go to System and Security > Administrative Tools > Schedule Tasks and add a new task.
For details see my guide for scheduling file transfers to FTP/SFTP server.
(I'm the author of WinSCP)

How to copy files on remote Windows to local Linux on a Linux machine?

Currently, I'm working on a local Linux machine. I'm trying to use scp or similar Linux command-line tools to copy files from a remote Windows machine to my local Linux. I did some searching and found that most of the solutions are for local Windows cases (like putty and winscp), which don't really help.
Please advise.Thank you.
[UPDATE] Solved by installing cygwin's sshd service on Windows.
If you really want to use SCP, you will need an SCP server (actually an SSH server) on the Windows machine.
For example freeSSHd.
You will need to choose one of the options based on your own needs, there are a number of similar tools and freeSSHd was the first in the list on Google. I've used the Bitvise SSH Server in the past but it is only free for non-commercial use.
They are usually very easy to set up. You install them the usual way and run them for the first time. Depending on the tool, they may pick up your existing Windows users or you may need to manually create some users with passwords within the tool. Then, armed with your PC's IP address, you should be able to connect to the PC using SSH from the Linux command line.
If the windows system has a shared folder you should be able access that with smbclient which is part of the terrific samba project.
Usually somthing like:
smbclient //winmachine/share
Possibly using the -U username options to specifiy the username on the windows box.
Once connected, you can use cd to change folders, and get to retrieve files.
If there is no file share.... I dunno. Create one?
Syntax for copying from remote Windows 10 machine with built-in SSH server. Note forward slashes and drive style. Domain is not necessary.
scp user#domain#example.com:c:/path/to/file.txt .

How to copy a file from my local disk to remote applicatin in Unix

Let's say I have created XML file inside C:/path/MyFolder/MyFile.xml. I want to copy them to my remote account in a Unix machine. ~/Home/www.
I read the tutorial, no where I see where I can copy or move file from my local to the remote system.
scp is a good suggestion, but for beginners i recommend sftp with a graphical client, like winscp or filezilla.
http://winscp.net/eng/index.php
https://filezilla-project.org/
I would use scp to send files to remote machines. For example:
scp C:/path/MyFolder/MyFile.xml user#remoteBox:/home/www/MyFile.xml
A common way to do this is scp (secure copy). A famous client ist putty.
Just google it ;) Of course, on the unix machine you must install a ssh-server (very often in the official repository).
You can use ftp or scp.
Maybe, from a Windows host you can easily use filezilla to do so. It's a very intuitive program.

Calling Linux command line in MATLAB

I have recently learned, that in MATLAB, the "!" mark runs the code in a command line and follwed by the "&" will pull up the command window, FOR EXAMPLE:
!RUN_FILE.bat&
It was a great day when I discovered this, or should I say when someone told me this. Anyways I was wondering if there was a way to run this batch file on a linux machine that I am connecting to remotley with a Windows desktop? (I am a newbie when it come to anything Linux, so if it doesn't make sense let me know and please dumb down you answers if you don't mind) haha
THANKS,
ME
The Linux shell doesn't understand batch files. That's not to say that the batch file can't be re-written to work in the Linux shell. Post some more information about the Linux shell you are using and your batch script and perhaps we can help you port it to Linux.
On a second read of your question, I interpreted it a different way. Are you running Matlab on a Linux machine that you are remotely connected to, or are you running Matlab on your local Windows machine and you want to send the ! command to the remote Linux box?
If the latter is true, then you should probably be able to write a batch file (to run from Matlab) that will launch the remote script on the Linux box. How are you connected to the Linux machine? VNC? SSH?
Windows and Linux use different shell scripting languages, so you couldn't run a .bat directly on Linux, but could create a bash script to perform the same actions.
You might want to see this bat2bash online converter (I prefer re-writing though):
http://www.filegod.netfirms.com/Bat2Bash.html

Resources