LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-05-2016, 11:58 PM   #1
l33y
Member
 
Registered: Jan 2014
Location: Gulf Coast, USA
Distribution: Xubuntu
Posts: 50
Blog Entries: 1

Rep: Reputation: Disabled
scp works only from ssh client to server


I configured an ssh client and ssh server on two Xubuntu desktops. I can ssh into the server from the client just fine. When I use scp to copy a file from the client to the server, it works just fine. However when I try to use the scp command to copy a file from the server to the client, I get the following:
Code:
ssh:  connect to host 192.168.0.13 port 22:  Connection refused
lost connection
It seems like it should work in the opposite direction. Any suggestions?

Last edited by l33y; 01-06-2016 at 12:00 AM.
 
Old 01-06-2016, 12:11 AM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,860
Blog Entries: 36

Rep: Reputation: 458Reputation: 458Reputation: 458Reputation: 458Reputation: 458
Increase the verbosity of your ssh command (e.g. ssh -vvv ...) on the client to see potentially hidden error messages. Since you're on an Ubuntu based distro tail -f /var/log/auth.log on the server while logging in. It will stream the logs. e.g. open two terminals.

Code:
#terminal 1 on the server tail logs
sudo tail -f /var/log/auth.log

#terminal 2 on the client verbosely SSH
ssh -vvv user@192.168.0.13
If you find auth.log isn't outputting any information you may need to increase the verbosity level of the logs on the server sshd. Do that by editing /etc/ssh/sshd_config.

Last edited by sag47; 01-06-2016 at 12:14 AM.
 
Old 01-06-2016, 01:11 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,088

Rep: Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142
also you may try to increase verbosity on the server side to check if they can communicate to each other
 
Old 01-06-2016, 01:58 AM   #4
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 3,462

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
Quote:
Originally Posted by l33y View Post
I configured an ssh client and ssh server on two Xubuntu desktops. I can ssh into the server from the client just fine. When I use scp to copy a file from the client to the server, it works just fine. However when I try to use the scp command to copy a file from the server to the client, I get the following:
Code:
ssh:  connect to host 192.168.0.13 port 22:  Connection refused
lost connection
It seems like it should work in the opposite direction. Any suggestions?
The error message indicates that there is connectivity, but nobody listens on the ssh port at the other side.
It's not quite clear what you are doing. Do you run the scp command on the client or the server when you receive the error message?
 
  


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
Proxy for ssh client and sftp/scp ? centosfan Linux - Server 5 06-04-2013 03:30 AM
Shell scp works perfectly, Net::SCP::Expect calls timing out - reasons? EnderX Programming 1 04-27-2013 01:35 AM
[SOLVED] ssh scp key not working to ssh/scp without password rjo98 Linux - Newbie 9 08-22-2011 04:28 PM
[SOLVED] scp/ssh to cygwin server from linux server without password prompt... blainemiller Linux - Server 7 05-18-2011 02:04 PM
graphical ssh/scp client of linux entz Linux - Software 6 10-01-2007 09:00 PM

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

All times are GMT -5. The time now is 11:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration