LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh problem (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-problem-912257/)

ust 11-06-2011 09:52 PM

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.

deep27ak 11-06-2011 10:25 PM

Quote:

Originally Posted by ust (Post 4517721)
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


ust 11-06-2011 11:24 PM

Quote:

Originally Posted by deep27ak (Post 4517734)
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.

deep27ak 11-07-2011 12:04 AM

Quote:

Originally Posted by ust (Post 4517754)
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 ::


pnmanojshenoy 11-07-2011 03:14 AM

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

unSpawn 11-08-2011 12:27 AM

Quote:

Originally Posted by ust (Post 4517721)
( 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.


All times are GMT -5. The time now is 12:54 AM.