LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-29-2011, 10:47 AM   #1
kyros
LQ Newbie
 
Registered: Dec 2011
Location: North America
Distribution: Ubuntu 11.04
Posts: 8

Rep: Reputation: Disabled
I need help with scp


Hi there...I have been trying to use scp on my macbook in order to transfer a file from the server to my macbook. This is what I'm typing on the command line:

Code:
scp -P 5699 kyros@serverIPAddress:some.file kyros@macbookIPAddress:~
ssh: connect to host serverIPAddress port 22: Connection refused
Please help
 
Old 12-29-2011, 10:54 AM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
You have put the port down as 5699, Is that the ssh port number, if you have not chnged the ssh port number leave the 5699 off.
 
Old 12-29-2011, 10:55 AM   #3
kyros
LQ Newbie
 
Registered: Dec 2011
Location: North America
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
thats the port number
 
Old 12-29-2011, 11:11 AM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
It seems strange that it reports connection to port 22 refused
 
Old 12-29-2011, 11:13 AM   #5
kyros
LQ Newbie
 
Registered: Dec 2011
Location: North America
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
does it matter that I'm behind a router?
 
Old 12-29-2011, 11:47 AM   #6
Sed_Awk
Member
 
Registered: Dec 2011
Location: USA
Distribution: Crux 2.7.1
Posts: 41

Rep: Reputation: 0
Does the server and/or client have firewalls? if so, you may need to open port 5699

Also, is the ssh deamon also running on kyros@macbookIPAddress

Because ssh sees it as you are trying to transfer a file from one ssh server to another ssh server. The ssh deamon may not be enable on the macbook side.

I usually transfer file(s) this way
scp -P 12345 user@IPADDRESS:~/foo .

For example, from a client machine, I transfer a file called foo from user@IPADDRESS:~/ to the current directory by the '.' sign

The ~ is for home directory. If the file resides elsewhere than use the absolute path.

Last edited by Sed_Awk; 12-29-2011 at 11:57 AM.
 
Old 12-29-2011, 11:59 AM   #7
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Quote:
Originally Posted by Sed_Awk View Post
Also, is the ssh deamon also running on kyros@macbookIPAddress

Because ssh sees it as you are trying to transfer a file from one ssh server to another ssh server.
Where do you get that from?? There is no need to run SSHD on the client.
 
Old 12-29-2011, 12:13 PM   #8
kyros
LQ Newbie
 
Registered: Dec 2011
Location: North America
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
well....I'm running an openSSH server on my ubuntu machine and connecting to the server via my macbook which are all on the same network. I'm not sure if I'm running a firewall...I never installed one unless it already comes installed on ubuntu 11.04 or macOSx.

I tried
Code:
scp -P 5699 kyros@serverIPAddress:~/file.name ./newFile.name
which all it does is copy the file.name back onto the server as newFile.name. ARG!!!
 
Old 12-29-2011, 12:18 PM   #9
Sed_Awk
Member
 
Registered: Dec 2011
Location: USA
Distribution: Crux 2.7.1
Posts: 41

Rep: Reputation: 0
I know you don't need sshd on the client side. The reason I mentioned that is because kyros had
Code:
scp -P 5699 kyros@serverIPAddress:some.file kyros@macbookIPAddress:~
The item in bold may be appear to scp as another server because of the user name, the @ symbol and the IP address.

That's way I said I transfer files this way below which works for me
Code:
scp -P 12345 user@IPADDRESS:~/foo .
So, if you're on a client machine i.e macbook, open a terminal and type

Code:
scp -P 5699 kyros@serverIPAddress:some.file .
The file will be copied from kyros@serverIPAddress to the current directory of the client machine.

Last edited by Sed_Awk; 12-29-2011 at 12:50 PM.
 
Old 12-29-2011, 12:49 PM   #10
phil555
LQ Newbie
 
Registered: Dec 2011
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by kyros View Post
I tried
Code:
scp -P 5699 kyros@serverIPAddress:~/file.name ./newFile.name
which all it does is copy the file.name back onto the server as newFile.name. ARG!!!
Is your server and client the same machine?
 
Old 12-29-2011, 12:57 PM   #11
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Have you tried to ssh into the server, will it conect that way?
 
Old 12-29-2011, 12:57 PM   #12
kyros
LQ Newbie
 
Registered: Dec 2011
Location: North America
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
no....they're two completely different machines. I even tried logging on to my school's server and I am getting the same results

Code:
> scp -v wolny@atlas.sheridanc.on.ca:~/command.history ./command1.history
Executing: program /usr/bin/ssh host atlas.sheridanc.on.ca, user wolny, command scp -v -f ~/command.history
OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to atlas.sheridanc.on.ca [142.55.2.89] port 22.
debug1: Connection established.
debug1: identity file /home/oa-homer3/124/wolny/.ssh/identity type -1
debug1: identity file /home/oa-homer3/124/wolny/.ssh/id_rsa type -1
debug1: identity file /home/oa-homer3/124/wolny/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5
debug1: match: OpenSSH_5.1p1 Debian-5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-5
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'atlas.sheridanc.on.ca' is known and matches the RSA host key.
debug1: Found key in /home/oa-homer3/124/wolny/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/oa-homer3/124/wolny/.ssh/identity
debug1: Trying private key: /home/oa-homer3/124/wolny/.ssh/id_rsa
debug1: Trying private key: /home/oa-homer3/124/wolny/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password: 
debug1: Authentication succeeded (keyboard-interactive).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending command: scp -v -f ~/command.history
Sending file modes: C0640 2428 command.history
Sink: C0640 2428 command.history
command.history                               100% 2428     2.4KB/s   00:00    
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 1536, received 4376 bytes, in 0.2 seconds
Bytes per second: sent 6741.5, received 19206.1
debug1: Exit status 0
 
Old 12-29-2011, 12:58 PM   #13
kyros
LQ Newbie
 
Registered: Dec 2011
Location: North America
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
Yeah...I can connect to the server no problem.
 
Old 12-29-2011, 01:29 PM   #14
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Can you try logging in to another (school) server from your server, instaed of from macbook?
 
Old 12-29-2011, 01:30 PM   #15
kyros
LQ Newbie
 
Registered: Dec 2011
Location: North America
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
i logged on to the school server via my ubuntu machine
 
  


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
[SOLVED] ssh scp key not working to ssh/scp without password anon091 Linux - Newbie 9 08-22-2011 04:28 PM
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-28-2008 11:41 PM
scp help akhil.mud Programming 6 04-14-2008 08:47 PM
SCP how to the_rhino Linux - Newbie 5 02-11-2005 07:50 PM
What is SCP? radam Linux - Software 2 07-20-2004 07:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:59 AM.

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