How to copy file from desktop to unix using ssh terminal command - unix

I am trying to copy a file called TEST.txt from my desktop to Unix server using SSH client. What command would I use to accomplish this task?
Many thanks!!

You need to use scp, like so:
scp /file/to/send username#remote:/where/to/put
Take a look here for more help: https://unix.stackexchange.com/questions/188285/how-to-copy-a-file-from-a-remote-server-to-a-local-machine

I assume you are running a Windows desktop. You can use the SFTP tool in PuTTy or FileZilla to copy files using your ssh credentials.

Related

Transferring a file through the CLI on the same network

I have a file on my desktop and I need to get it onto another server, but I have no means of getting it there, i.e. email/usb or any way like that.
The server is on the same network as me.
I have heard of a way that the file can be copied via the command line.
Would anyone have any information on this and if so could you please help me?
Not sure whether you have command line access to that server or not? If yes, are you accessing it via telnet or via ssh?
If ssh, you should be able to transfer the file via SCP (secure copy), since it uses the same ssh connection you use to get your cli. If you want to transfer your file from a Windows environment, you may want to look at WinSCP, else do a man scp on your Linux or Unix server and, assuming you have it, you'll get the hang of it... it's not complicated.
If ssh is not an option, then you depend on the server having some service available for you to transfer the file, most obvious one being FTP.
Does that help?

Download a file from remote server in UNIX

I have a file on a remote server that I can connect to via ssh. I would like to copy the file from the remote server at the path: '/home/example.txt' to my computer's desktop.
Should I be using wget, sftp, ftp, or simply rm?
Bonus points if you know a good resource for UNIX documentation, since google's results were not great.
Use scp(1):
~$ scp user#host:/home/example.txt .
None of them, you should use scp
scp or rcp if you don't want/need to be secured. Or alternatively rsync will be nicer for anything more complicated with remote file transferring on a regular basis.
For the documentation, look at the man pages, ex: man scp. Or online at
http://linux.die.net/man/1/scp
http://linux.die.net/man/1/rcp
http://linux.die.net/man/1/rsync
Try Filezilla Utility
More info on http://filezilla-project.org/

Example SFTP batch upload script for AS400 server to upload to a Unix SFTP server

Suppose I have a file called helloworld.txt on an AS400 and I want to write a script to automate the daily upload of the source file helloworld.txt on an AS400 server to upload to a Unix SFTP server, say sftp://exampleunixsftp.com?
Does someone have such a script? Is OpenSSH the only tool that can be used on the AS400 to get this accomplished or are there any other methods? If LFTP could be installed on the AS400, that would be an easy solution but since it's only for Unix/Linux/Win/Mac then I don't have this option. I read Scott Klement's article at:
http://systeminetwork.com/article/ssh-scp-and-sftp-tools-openssh
I just need an example basic script to get this done. I'd appreciate this.
The MidrangeWiki topic on SSH has some information and examples that may be helpful.
sftp is intended primarily as an interactive utility. scp performs the same function non-interactively.
The command, once authentication is set up, would simply be:
scp helloworld.txt username#exampleunixsftp.com:<destination path>
LFTP can be installed with some preparation in the PASE environment. See Open Source Binaries. Currently offline. Use the Google cache.

Unix Shell script to copy files from unix location to windows FTP

Could anyone provide me Unix shell script to copy files from unix location to windows FTP location.
Thanks,
Chaitu
I'm going to assume you have access to the unix box. Sounds like a simple cron job using ftp. You'll need to review the crontab syntax to set that up. Check out this article on scripting FTP to get you started there.

Can I use a scp to download a file using shell script

Can I automate a download of a file from a system using scp(by entering the user id/password) and manipulate the file and upload it to the same place. If you have any idea of using scp in a shell script, pls do let me know
Thanks
Scp is ordinary command line uility in linux so it might be used directly. See this page for examples.
Yes you can automate that from a shell script pretty easily, but the question that remains is whether you want to input the password manually everytime you run the script or use ssh keys to accomplish authentication and achieve full automation.
Check this tutorial on using SCP.
use ssh-copy-id [the command varies by distro, but on Ubuntu it is ssh-copy-id]. here's how:
ssh-copy-id ~/.ssh/id_rsa.pub me#mysite.com this will install your public key to the remote host. it will not ask for your password if you do this! If you have no ~/.ssh/id_rsa.pub, then run ssh-keygen and accept all the default options [just press enter when it prompts for input].

Resources