alternative for net use in Linux - 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.

Related

Find linux command to transfer file over SFTP

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.

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.

How to transfer a live data stream from a linux headless system to a windows machine?

I've recently been working with the NAO. We're trying to connect the NavChip to it and do some experiments related to robot navigation. The NAO uses a modified 2.6 linux kernel on it's geode system. I've managed to make my NavChip work on it (needed to compile the linux cp210x kernel module etcetera). I can therefore run a C program that came with the NavChip and collect data from it. However, the data can only be logged on the local file system. I'd like to stream this data over the network to a windows machine, since all the processing is MATLAB based. Would anyone have any suggestions on how I can send this data from the NAO to a windows machine?
The NAO's system is pretty limited. It has ssh, and some common utilities like cat etc., but nothing advanced.
I'm not sure I understand the problem properly but I think you've answered your own question you mentioned ssh is installed so why not just scp the file? Using some ssh client on the windows box to remotely connect and download relevent log file.
If you really do need to push the file from the remote host to local machine (rather then connect to remote host and download to local) then netcat should work see here: http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/
Other wise just write your own socket program in C and pipe the file accross (should be pretty trivial).

Resources