LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-11-2003, 02:11 PM   #1
ckupris
LQ Newbie
 
Registered: Jun 2003
Posts: 12

Rep: Reputation: 0
ssh scp problem


I have been trying for hours to do what should be a simple file copy using the scp command but havent had any sucsess.

I am trying to copy a file from the remote machine to my machine, the remote machine is at the uni i attend. I m having no problems logging in and editing files on the remote machine. From what I have read from the manual pages the command to do the copy should look somthing like this-

scp /path/to/file/on/remote/machine user@machine:/path/to/destination

so i put in the details of the path to the source and destination and the username and machine name of the destination machine (the local machine as it were) and i get the following error-

ssh: kupris:name or service not known (kupris being the local machine name)

so the remote machine doesnt know where my local machine is, so how to i sort this out? i have tried using my IP address instead of computer name but probaly due to the nature of the university network it cant find my machine.

any help would be greatly appreciated, its driing me mental.

thanks

ck

Last edited by ckupris; 10-11-2003 at 02:13 PM.
 
Old 10-11-2003, 02:19 PM   #2
DoubleOTeC
Member
 
Registered: Aug 2003
Location: Dominica
Distribution: RedHat, FC1, FC3, FC4
Posts: 266

Rep: Reputation: 30
scp user@machine:/path/to/file/on/remote/machine /path/to/local destination/
 
Old 10-11-2003, 02:21 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Close but not quite - the syntax is:
scp source_file destination_file

To refference a remote file you need to give the name of the host and a username as well - eg:
user@machine:/path/to/file/on/remote/machine

When you used this you were making the remote machine the destination:
user@machine:/path/to/destination

So the command you really want is:
scp user@machine:/path/to/file/on/remote/machine /path/to/destination
 
Old 10-11-2003, 03:02 PM   #4
ckupris
LQ Newbie
 
Registered: Jun 2003
Posts: 12

Original Poster
Rep: Reputation: 0
thank for your help but i m still having problems, i have run the command as you said but strange things are happening.

the details of the remote machine and paths:

remote machine - plato
user - ckupris
remote path - /home/ckupris/file.txt
destination - /home/colin (on local machine)


so i enter the command accordingly

scp ckupris@plato:/home/ckupris/file.txt /home/colin

then its says permission denied to the destintion folder, the permission of the folder is set to permit everything (chmod 777) . so i was messing about trying to get it to work and set the destination to /home/ckupris/archive which is a folder on the remote machine and low and behold it copies the file. so obviously its trying to copy the file to the itself and not my machine, any ideas why?
 
Old 10-11-2003, 03:05 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Using:
scp ckupris@plato:/home/ckupris/file.txt /home/colin

Will try to create a file called colin in /home with the contents of file.txt to put the file in the folder colin you need to use this (extra slash means a directory):
scp ckupris@plato:/home/ckupris/file.txt /home/colin/
 
Old 10-11-2003, 03:23 PM   #6
ckupris
LQ Newbie
 
Registered: Jun 2003
Posts: 12

Original Poster
Rep: Reputation: 0
ok sorry newbie mistake, but now all i get is-

/home/colin/ :Is a directory

which is obvious but it wont copy the file to the directory.

i've tried /home/colin/file and /home/colin/file.txt but as you would expect it says that tey dont exist which is true.

i m sure this seems like pulling teeth but i m a newbie and have tried everything

thanks again
 
Old 10-11-2003, 05:17 PM   #7
DoubleOTeC
Member
 
Registered: Aug 2003
Location: Dominica
Distribution: RedHat, FC1, FC3, FC4
Posts: 266

Rep: Reputation: 30
if all else fails.....sftp
 
  


Reply



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
ssh and scp problem DAChristen29 Linux - Networking 4 01-05-2005 04:27 PM
Problems with SSH / SCP henriette Linux - Networking 1 04-28-2004 01:52 AM
Ssh/scp Gui MattLaw Linux - Networking 2 02-18-2004 04:45 PM
difference between SSH and SCP palanisaravanan Linux - Security 8 12-28-2003 11:07 PM
sshd, ssh, scp, help Stimm Linux - Security 3 03-25-2001 05:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration