Problem with ssh and scp


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Problem with ssh and scp
# 1  
Old 04-09-2010
Problem with ssh and scp

Hi there,

I'm working with two linux servers and if I use ssh to connect from 1 to 2 everything works fine ( ..as usualSmilie), while if I try to connect via ssh or to copy files through scp (as I usually do...) from 2 to 1, after the password I get this message:

Connection closed by IP_server1
lost connection

I've already tried to switch off the firewall but it didn't work...

I've also noticed that in the server 1 with the command:

echo "`date \"+%d/%m/%Y %H.%M.%S\"`;`curl --head --max-time 5 Google 2>/dev/null | head -1`"

I don't get this usual message:
Code:
03/04/2010 18.30.01;HTTP/1.1 200 OK

but this one:
Code:
09/04/2010 11.30.01;

Maybe there could be a link?


Any help would be really appreciated!!!Thanks in advance!

Giordano Bruno

---------- Post updated at 02:51 PM ---------- Previous update was at 02:19 PM ----------

... now everything works fine and with the command:

echo "`date \"+%d/%m/%Y %H.%M.%S\"`;`curl --head --max-time 5 Google 2>/dev/null | head -1`"

I get the usual message:
Code:
03/04/2010 18.30.01;HTTP/1.1 200 OK

....so it' s a problem of the net?? Even if I can use internet (but today it's really slow)... sorry to bother you with my question ... but could anyone explain me what's happened???


Thanks!!!

Last edited by Yogesh Sawant; 04-19-2010 at 04:20 PM.. Reason: added code tags
# 2  
Old 04-09-2010
Which OS are you using?

Check your

Code:
/etc/hosts.allow

and

Code:
/etc/hosts.deny

Also try to run scp with the "-v" flag.

What's in the logs on the server?
# 3  
Old 04-12-2010
I'm using Linux Fedora 6, and now everything works fine, but could you explain how is it possible to get diffent messages with the comman curl?

Thanks in advance!!!

GB
# 4  
Old 04-12-2010
Quote:
Originally Posted by Giordano Bruno
I'm using Linux Fedora 6, and now everything works fine, but could you explain how is it possible to get diffent messages with the comman curl?
What do you mean? What message is it giving, and what message would you want it to give?
# 5  
Old 04-12-2010
Please give a look to the update of my first messagge...

Thanks for your time!!!
# 6  
Old 04-12-2010
I've read your OP, and don't understand how your question relates to it. (or perhaps at all.) What message curl gives you usually relates to what you're telling it to do. What is it giving, and what do you want it to give instead?

Last edited by Corona688; 04-12-2010 at 03:58 PM..
# 7  
Old 04-13-2010
Maybe you're getting an error message when you run the curl part and since you're sending STDERR to a null device probably that's why you are not seeing anything on the screen.

Example:

Code:
[test1@atlas ~]$ curl --head --max-time 5 localhost 2>/dev/null | head -1
HTTP/1.1 200 OK
[test1@atlas ~]$ curl --head --max-time 5 asdf123 | head -1
curl: (6) Couldn't resolve host 'asdf123'
[test1@atlas ~]$ curl --head --max-time 5 asdf123 2>/dev/null | head -1
[test1@atlas ~]$

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Ssh find and scp

Hello All, I have a requirement to copy few files from remote server to local, and below are the sequence ssh to the remote host finding the files with the specific condition once found scp to the local server path for (( i=0; i<${tLen}; i++ )) do ssh... (1 Reply)
Discussion started by: nextStep
1 Replies

2. Solaris

ssh and scp not working

Dear All, whenever i try the command ssh , it is giving the below error. ld.so.1: ssh: fatal: relocation error: file /usr/bin/ssh: symbol SUNWcry_installed: referenced symbol not found Killed For SCP also the same error is coming. Pl reply me if you have answers. Rj (4 Replies)
Discussion started by: jegaraman
4 Replies

3. AIX

scp not working while ssh works

I try to transfer a file from a Linux host to an AIX-host via scp, which fails. Logging into the AIX-system from the same Linux-system via ssh works well and i am a bit at a loss where to look. The original setup was with a user account provided via LDAP, but because of the error message (see... (4 Replies)
Discussion started by: bakunin
4 Replies

4. Shell Programming and Scripting

SSH and SCP HELP

Hi all Iam using ssh and trying to change to a different user but im not able to do it. -------- Script.sh ssh user@hostname sudo rootsh whoami -------- -------- Script2.sh ssh user@hostname su - username password whoami --------- When i run the Script.sh it is connecting to... (4 Replies)
Discussion started by: coolkid
4 Replies

5. UNIX for Advanced & Expert Users

Simulating scp through ssh

How to simulate scp command using ssh? (5 Replies)
Discussion started by: vickylife
5 Replies

6. Solaris

SSH/SCP Question

Thanks to this forum, I was able to get a program running that uses SSH to control programs running on other hosts. Now I'd like to enhance it. The control program on the target hosts occassionally needs to be updated. Updating the menu program on the source host is easy as it is on one host. ... (1 Reply)
Discussion started by: PabloCruise77
1 Replies

7. AIX

ssh and scp in aix 4.3.3

I'm using scp to copy files to another company via our 4.3.3 server. I am having transfer problems right at the transfer point in scp. Below are 2 debug outputs showing the bottleneck. The lower level debug preceeds the higher level debug output. It just seems to stop and refuses to transfer... (0 Replies)
Discussion started by: oldogbert
0 Replies

8. Shell Programming and Scripting

ssh/scp - can you specify timeout?

I am scp'ing a file from a server (servera) to my server (serverb) If servera is down - the scp never times out ... it just hangs eternally.. It is possible to specify a timeout in my script - so if scp fails/hang for more than 60 seconds I assume its failed ? I am aware there is some... (3 Replies)
Discussion started by: frustrated1
3 Replies

9. BSD

SCP and ssh

I can't get ssh ans scp to work between to host on my network. I am prompted for the password and it isn't accepting the password and I know the password is correct because I am using the root password. What do I need to do to get ssh working between the two host and scp. I can putty into the... (2 Replies)
Discussion started by: rbizzell
2 Replies

10. Shell Programming and Scripting

SSH and SCP

The following ksh script is trying to get a file's cksum then, scp it over to a remote machine - get the cksum there and then compare the two cksums to make sure they match. I am having problems setting a variable on the remote host where it can be read locally. Is this even possible - reading a... (1 Reply)
Discussion started by: berrean
1 Replies
Login or Register to Ask a Question