LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-06-2011, 10:52 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
ssh problem


I have just install Redhat 4 to server , I found that when I use ssh ( i.e. ssh -l root server_name ) to connect it , it need a few seconds to return the password prompt , it is quite slow response , the ping time is "time=0.316 ms" , it is normal , and no firewall is enabled , the other server do not have the same problem ,

can advise what will be the possible reason of the problem ?

Thanks.
 
Old 11-06-2011, 11:25 PM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by ust View Post
I have just install Redhat 4 to server , I found that when I use ssh ( i.e. ssh -l root server_name ) to connect it , it need a few seconds to return the password prompt , it is quite slow response , the ping time is "time=0.316 ms" , it is normal , and no firewall is enabled , the other server do not have the same problem ,

can advise what will be the possible reason of the problem ?

Thanks.
The possible reasons could be
Code:
1. misconfiguration of hosts and resolv.conf file
2. your sshd_config is configured to look for IPv6 at first and then for IPv4 so it is taking time to connect to remote host.
Solution
Code:
#vi /etc/ssh/sshd_config
UseDns no
 
1 members found this post helpful.
Old 11-07-2011, 12:24 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by deep27ak View Post
The possible reasons could be
Code:
1. misconfiguration of hosts and resolv.conf file
2. your sshd_config is configured to look for IPv6 at first and then for IPv4 so it is taking time to connect to remote host.
Solution
Code:
#vi /etc/ssh/sshd_config
UseDns no
if I really use IP v6 , how to change it to v4 ?

Thanks.
 
Old 11-07-2011, 01:04 AM   #4
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by ust View Post
if I really use IP v6 , how to change it to v4 ?

Thanks.
Look for this option with the order they are placed in sshd_config

Code:
ListenAddress 0.0.0.0
ListenAddress ::
 
Old 11-07-2011, 04:14 AM   #5
pnmanojshenoy
Member
 
Registered: Jun 2008
Location: Cochin, India
Distribution: Debian,Ubuntu
Posts: 38

Rep: Reputation: 0
Hello,

There are two methods to speed up SSH connection

1, As already told

#vi /etc/ssh/sshd_config
UseDns no

2, Force SSH to use only IPv 4
#vi /etc/ssh/ssh_config
AddressFamily inet

Use this command to SSH

#ssh -4 username@hostname

Try works g8 in Ubuntu, let me know how it works in Redhat
 
Old 11-08-2011, 01:27 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by ust View Post
( i.e. ssh -l root server_name )
FWIW you should not allow root to connect to any service over any (hostile) network. It simply is not a security best practice.
 
  


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
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 03:23 AM
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 03:50 AM
SSH problem - ssh-add not respond FerkoPica Linux - Security 6 05-07-2006 04:47 PM
ssh problem after creating an ssh alias. porotothorpe Linux - General 2 01-25-2006 08:56 PM


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