LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-08-2004, 11:51 AM   #1
shrike_912
LQ Newbie
 
Registered: Jun 2004
Location: nepal
Posts: 26

Rep: Reputation: 15
trying to copy files from another machine to the local machine using telnet,..how?


Is it possible to copy files from a remote host to the local host using telnet? If yes, how?

----------------------
shrike_912
----------------------
 
Old 06-08-2004, 12:12 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 46
Don't know about doing it with telnet because I've never used it. You really shouldn't either... It sends everything, including your login/password, across the network as plain text. Not even a thought of security.

Instead, you should use ssh (Secure SHell) to remotely login. When you have that running, you can then use scp (Secure CoPy) to transfer files...

$ scp user@from_computer:dir/filename user@to_computer:dir/filename

I know there's a similar rcp (Remote CoPy), but I'd guess it's not too secure.
 
Old 06-09-2004, 02:19 AM   #3
Kumar
Member
 
Registered: Sep 2003
Location: Pune, India
Distribution: Red Hat
Posts: 106

Rep: Reputation: 15
No as far as i know. You will have to either use ftp or scp for that. See the related man pages for more information.
 
Old 06-09-2004, 02:29 AM   #4
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
actually scp only supports local-to-remote or remote-to-local transfers... if you have to go remote->remote with scp, ssh into one box (if scp is listening, ssh must be as well) and scp from that box to the other. IE:

ssh box1
username: me
password: bunk

scp ./foo me@box2:~

HTH

B.
 
Old 03-14-2006, 08:13 AM   #5
joking
LQ Newbie
 
Registered: Feb 2004
Location: Western NC
Distribution: RH 5.2, 7.3, Fedora, Gentoo
Posts: 15

Rep: Reputation: 0
system1 @ 10.0.0.1
system2 @ 10.0.0.2

on system1: /etc/exports = /myexport *(rw,no_root_squash)
export exports
on system2: mount 10.0.0.1:/myexport /mnt/remote
move files to system1 by: cp /someexport/thatfile /mnt/remote

if you want to transfers files back: cd /local_directory
cp /mnt/remote/that_other_file .

if you want to copy from system1 to 2 just create an export on system2 and then use the appropriate command.
 
Old 03-14-2006, 04:06 PM   #6
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
You may use netcat, see nc(1)

It's easy, once you connect (with either ssh or telnet), you open a port in any machine with nc, then you use nc on the other to transfer data. The choice of machine depends on your configuration, firewalls, etc.

For example, to open a port in any machine and redirect output to a file, you'd do:

nc -l 40000 | bunzip2 -c > myfile

Then, to transfer it, you'd do:

cat myfile | bzip2 -c | nc $IP 40000
 
Old 03-14-2006, 04:45 PM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
If you really have no other option than using telnet, you can still download files through it.

If they are plain text files, run the "script" command before launching the telnet command, on the remote host "cat" your text file then logout.
After exiting the script command, you'll have a file named "typescript" that will contain all your telnet transaction, just edit this file by removing the unnecessary header, trailers and the carriage returns at each end of line and you are set.

If you want to to transfer a binary file, use the same technique, but instead of using cat, use:
uuencode -m filename < filename

On the local host, use uudecode to process the typescript, it will extract the binary file.

Last edited by jlliagre; 03-14-2006 at 04:49 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy files from telnet session to local drive rkemp Linux - Networking 7 03-11-2009 05:01 AM
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 12:23 PM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 07:39 PM
client can't copy files to local machine through vsftpd server on RH9 tree_buddy Linux - Networking 7 09-15-2003 10:54 AM
Using SMB to copy files from one linux machine to second linux machine. coppersky Linux - Networking 9 06-24-2003 12:07 PM


All times are GMT -5. The time now is 07:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration