I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Can someone guide me through this?
Surya
On Sat, Aug 7, 2010 at 12:46 PM, Surya Sharma s@iamsurya.com wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
If you want to tranfer files from node A to node B without any initiative from node B, you can set up a cron job on node A to SCP the files to node B. To avoid being prompted for a passwords, you can set up keyless SSH.
Regards, NMK.
On Sat, Aug 7, 2010 at 2:16 PM, Surya Sharma s@iamsurya.com wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Not sure if ftp client supports wildcard(*). If yes, then - Login to transferring node using SSH - Create FTP session using FTP client with other node - Upload files (PUT *)
BTW, there are many alternatives to do so.
If you ask me, I use netcat to do that. Create tarball. Transfer tarball. Verify MD5.
I'm used to this, so it doesn't take much time for me to do that all :-)
HTH
Can someone guide me through this?
Surya
On Sat, Aug 7, 2010 at 1:49 PM, Sagar Belure sagar.belure@gmail.com wrote:
On Sat, Aug 7, 2010 at 2:16 PM, Surya Sharma s@iamsurya.com wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Not sure if ftp client supports wildcard(*).
It does, provided you use mput instead of put. It will then ask you the windows-style "are you sure?" for each filename that matches the regex, which can be gotten rid of by "set prompt off". That said, it is a bit quirky to use FTP via cron - you will have to use either here docs or an expect script.
Ah, not to forget - FTP (and not SFTP), sends data in clear text and should never be used when SSH is an alternative. Most Security Analysts I know look down upon using FTP to transfer files between *nix nodes. But that's going off on a tangent....
Regards, NMK.
On Saturday 07 August 2010 14:16:39 Surya Sharma wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Can someone guide me through this?
If you have ssh you should have scp. scp user1@aa.bb.cc.dd:/x/y user2@nn.mm.oo.pp:/z/y
You need to setup passwordless ssh.
On Sat, Aug 7, 2010 at 4:10 PM, jtd jtd@mtnl.net.in wrote:
On Saturday 07 August 2010 14:16:39 Surya Sharma wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Can someone guide me through this?
If you have ssh you should have scp. scp user1@aa.bb.cc.dd:/x/y user2@nn.mm.oo.pp:/z/y
You need to setup passwordless ssh.
Very first result for 'file transfer via ssh' http://en.kioskea.net/faq/794-file-transfer-via-ssh
HTH.
-- Rgds JTD -- http://mm.glug-bom.org/mailman/listinfo/linuxers
On Saturday 07 Aug 2010, jtd wrote:
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
If you have ssh you should have scp. scp user1@aa.bb.cc.dd:/x/y user2@nn.mm.oo.pp:/z/y
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Regards,
-- Raj
On Sunday 08 August 2010 19:57:17 Raj Mathur (राज माथुर) wrote:
On Saturday 07 Aug 2010, jtd wrote:
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
If you have ssh you should have scp. scp user1@aa.bb.cc.dd:/x/y user2@nn.mm.oo.pp:/z/y
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
On Sunday 08 Aug 2010, jtd wrote:
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
Cool, just validated that it works that way. Didn't know this earlier, useful piece of information to have.
Regards,
-- Raj
On Sunday 08 August 2010 10:31 PM, Raj Mathur (राज माथुर) wrote:
On Sunday 08 Aug 2010, jtd wrote:
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
Cool, just validated that it works that way. Didn't know this earlier, useful piece of information to have.
Does the flow of data bypass the control machine? Are packets directly going from aa to nn?
On Monday 09 Aug 2010, Rony wrote:
On Sunday 08 August 2010 10:31 PM, Raj Mathur (राज माथुर) wrote:
On Sunday 08 Aug 2010, jtd wrote:
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
Cool, just validated that it works that way. Didn't know this earlier, useful piece of information to have.
Does the flow of data bypass the control machine? Are packets directly going from aa to nn?
Yes, that's what I confirmed by transferring a large file two remote servers and watching my traffic.
Regards,
-- Raj
On Monday 09 August 2010 10:03 PM, Raj Mathur (राज माथुर) wrote:
On Monday 09 Aug 2010, Rony wrote:
On Sunday 08 August 2010 10:31 PM, Raj Mathur (राज माथà¥à¤°) wrote:
On Sunday 08 Aug 2010, jtd wrote:
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
Cool, just validated that it works that way. Didn't know this earlier, useful piece of information to have.
Does the flow of data bypass the control machine? Are packets directly going from aa to nn?
Yes, that's what I confirmed by transferring a large file two remote servers and watching my traffic.
Before you did this experiment, has aa ever established an ssh connection with nn or vice versa? Suppose aa and nn have never communicated with each other, if aa is giving a key to nn, how does nn say 'yes' to accept it, through a third party control machine? I am not doubting your experiment but only clearing my own understanding of ssh so no offense intended. Could you try the same experiment on virgin machines?
On Monday 09 Aug 2010, Rony wrote:
On Monday 09 August 2010 10:03 PM, Raj Mathur (राज माथुर) wrote:
Yes, that's what I confirmed by transferring a large file two remote servers and watching my traffic.
Before you did this experiment, has aa ever established an ssh connection with nn or vice versa? Suppose aa and nn have never communicated with each other, if aa is giving a key to nn, how does nn say 'yes' to accept it, through a third party control machine? I am not doubting your experiment but only clearing my own understanding of ssh so no offense intended. Could you try the same experiment on virgin machines?
I have ssh auth forwarding and key-based login on both machines, and that might explain why one talked to the other. I'm too lazy to try with passwords and no auth forwarding, let someone else do it!
Regards,
-- Raj
On Sunday 08 August 2010 09:49 PM, jtd wrote:
On Sunday 08 August 2010 19:57:17 Raj Mathur (राज माथुर) wrote:
On Saturday 07 Aug 2010, jtd wrote:
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
If you have ssh you should have scp. scp user1@aa.bb.cc.dd:/x/y user2@nn.mm.oo.pp:/z/y
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
I doubt if aa will start a secure connection with nn if keys are with someone else. Has this been tried on fresh machines that have no previous keys stored? What will happen is that the control machine establishes ssh connections with both machines and aa will transfer data to nn *via* the control host through some memory buffer, which the OP does not want to do. This is also a double load on the internet connections. The 2 hosts may have high speed internet grade connections whereas the control host may be just a piddly low speed remote link.
On Mon, Aug 9, 2010 at 12:22 PM, Rony gnulinuxist@gmail.com wrote:
On Sunday 08 August 2010 09:49 PM, jtd wrote:
On Sunday 08 August 2010 19:57:17 Raj Mathur (राज माथॠर)
wrote:
On Saturday 07 Aug 2010, jtd wrote:
What I want to do is transfer files from one to another without
my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
If you have ssh you should have scp. scp user1@aa.bb.cc.dd:/x/y user2@nn.mm.oo.pp:/z/y
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
I doubt if aa will start a secure connection with nn if keys are with someone else. Has this been tried on fresh machines that have no previous keys stored? What will happen is that the control machine establishes ssh connections with both machines and aa will transfer data to nn *via* the control host through some memory buffer, which the OP does not want to do. This is also a double load on the internet connections. The 2 hosts may have high speed internet grade connections whereas the control host may be just a piddly low speed remote link.
Running a tcpdump on the control host will answer this question.
Regards, Mohan S N
On Monday 09 August 2010 21:52:21 Rony wrote:
On Sunday 08 August 2010 09:49 PM, jtd wrote:
On Sunday 08 August 2010 19:57:17 Raj Mathur (राज
माथ�र) wrote:
On Saturday 07 Aug 2010, jtd wrote:
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
If you have ssh you should have scp. scp user1@aa.bb.cc.dd:/x/y user2@nn.mm.oo.pp:/z/y
Will this actually transfer between aa and nn without routing the data through the local host? Can someone confirm definitively?
Essentially control tells aa to send data to nn. which is the same as ssh to aa, fire script (which transfers data to nn) and get out leaving script running.
So all data flows only from aa to nn.
I doubt if aa will start a secure connection with nn if keys are with someone else. Has this been tried on fresh machines that have no previous keys stored?
That is why you require paswordless ssh, or prior exchange of keys. Besides I am quite sure you would not want to have that capability anyway.
What will happen is that the control machine establishes ssh connections with both machines and aa will transfer data to nn *via* the control host through some memory buffer, which the OP does not want to do.
This never happens. scp does not work as a relay, but as a command and control system. So it is the exact same as ssh into aa, fire script to transfer to nn. getout. Script can also use stuff like expect to automate a first time connection between two machines or use GSSAPIKeyExchange (neither of which I have used before). Hence no data flows to control.
This is also a double load on the internet connections. The 2 hosts may have high speed internet grade connections whereas the control host may be just a piddly low speed remote link.
On Sat, Aug 7, 2010 at 2:16 PM, Surya Sharma s@iamsurya.com wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Can someone guide me through this?
Besides, the suggested solutions by other members, 'rsync' over ssh will also do the job. The "--archive" will take care of the common backup options in case that is your objective to copy files from /public_html folders.
-- Arun Khan
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Can someone guide me through this?
scp user@host1:/path/to/file user@host2:/path/to/
This would transfer (using ssh) from host1 to host2, whereas the client running this command could be anywhere, as long as he/she has permissions to access host1 and host2
Hope that helps. -Sanjay
On Saturday 07 August 2010 05:53 PM, b@pad.ma wrote:
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
scp user@host1:/path/to/file user@host2:/path/to/
This is so simple. :-) Never thought of this.
I just have one query. How will it sequentially ask for passwords and where will the ssh key be stored? If I get the key from one remote host into my client machine, how will the other host gain access on that key. Unless of course the same key is set up manually in advance on all machines.
On Sat, Aug 7, 2010 at 8:55 PM, Rony wrote:
I just have one query. How will it sequentially ask for passwords and where will the ssh key be stored? If I get the key from one remote host into my client machine, how will the other host gain access on that key. Unless of course the same key is set up manually in advance on all machines.
If keys are not setup, it will sequentially ask for the passwords: [user3@host3 ~]$ scp user1@host1:file user2@host2:. user1@host1's password: user2@host2's password:
If you want to use key based authentication then you need to add user3's public key in user1's authorized keys and user1's public key in user2's authorized keys.
-- Regards Osric Xavier Fernandes
On Sunday 08 August 2010 02:08 PM, Osric Fernandes wrote:
On Sat, Aug 7, 2010 at 8:55 PM, Rony wrote:
I just have one query. How will it sequentially ask for passwords and where will the ssh key be stored? If I get the key from one remote host into my client machine, how will the other host gain access on that key. Unless of course the same key is set up manually in advance on all machines.
If keys are not setup, it will sequentially ask for the passwords: [user3@host3 ~]$ scp user1@host1:file user2@host2:. user1@host1's password: user2@host2's password:
That is fine but the keys are being given to host3. Why will hosts 1 and 2 start a secure connection between each other based on keys given to host3?
Greetings,
On Sat, Aug 7, 2010 at 2:16 PM, Surya Sharma s@iamsurya.com wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
Have you looked at lftp?
Regards,
Rajagopal
On Saturday 07 August 2010 02:16 PM, Surya Sharma wrote:
I've got two hosts which allow ssh login, and ftp.
What I want to do is transfer files from one to another without my client system downloading any files. (both have /public_html folders. The files from one need to be xfered to another)
ssh into one machine and scp from that machine to the third machine.