Unix/Linux Go Back    

UNIX for Beginners Questions & Answers If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

Help with FTP in UNIX

UNIX for Beginners Questions & Answers

batch file, ftp file, putty command, unix & linux - unix commands

Thread Tools Search this Thread Display Modes
Old Unix and Linux 5 Days Ago   -   Original Discussion by richa shukla
richa shukla's Unix or Linux Image
richa shukla richa shukla is offline
Registered User
Join Date: Apr 2018
Last Activity: 16 April 2018, 6:50 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Help with FTP in UNIX

Hi All,

I am a beginner in Unix, wanted to know can we FTP one file located in one server to the another server location using Putty. The destination would require user ID and password to access the location. Also, the file that needs to be picked up should have the date of previous day.

Thanks in advance.
Sponsored Links
Old Unix and Linux 5 Days Ago   -   Original Discussion by richa shukla
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
Join Date: Feb 2004
Last Activity: 21 April 2018, 4:33 PM EDT
Location: NM
Posts: 11,353
Thanks: 602
Thanked 1,153 Times in 1,062 Posts
Sure. Download pscp (Putty secure copy) program from the putty site.
The link below is a full set of instructions on how to set up pscp. But this involves using a windows box. That is not what you want. Forget putty for this.

You already have everything you need on unix. Free. No downloads. It is called scp, /usr/bin/scp

scp uses the ssh protocol to send files.

The link also has how to set up ssh on Linux/UNIX. That is what you want.

Set up SSH public-key authentication to connect to a remote system

Here is how it works:
On the machine that receives files you create what are called ssh keys. One of those keys is a public key. Keys live in a special directory which is in the same location for every user that wants ssh. You take the public key you just made and place that key on the sender machine(s) in the same special directory.

For every server that has files sent to it you have to set up ssh keys, then place them on remote sender machines(s). So you can have lots of public keys in one sender user's ssh directory. One for each server.

There is a lot more detail to this. Follow the link I gave you.

Once you have ssh keys on the remote sender machine the two commands you need are

# send file
scp remoteusername@recieverbox myfile /path/to/remote/myfile 
# the date you want is a long string of numbers: [[[[cc]yy]MM]dd]hhmm[.ss]
# yesterday at noon for me is 201804151200   you do not have to use the [.ss] part for seconds
# we have ssh keys setup so ssh works, too.
ssh  remoteusername@recieverbox touch -t 201804151200 /path/to/remote/myfile


Last edited by jim mcnamara; 5 Days Ago at 07:14 AM..
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX script to FTP file from UNIX server to windows himakiran9 Shell Programming and Scripting 2 11-02-2011 02:35 AM
ftp from windows to unix using a perl script on unix machine raksha.s Shell Programming and Scripting 3 02-26-2009 11:18 PM
MVS->Unix FTP : Using chmod as part of FTP. videsh77 UNIX for Advanced & Expert Users 1 10-10-2007 11:12 AM
FTP script to FTP file to UNIX - Solaris bobk544 Shell Programming and Scripting 3 06-20-2007 01:54 PM
FTP script for sending a file from one unix directory to another unix server director raja_1234 Shell Programming and Scripting 1 11-30-2006 06:57 AM

All times are GMT -4. The time now is 07:25 PM.