LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-04-2010, 11:06 PM   #1
ramesh14
Member
 
Registered: Apr 2008
Location: Hyderabad
Distribution: RHEL5,Fedora 8/9
Posts: 119
Blog Entries: 1

Rep: Reputation: 15
login in ssh


Hi all,

In My environment i'm using both rhel5 & fedora 9. My previous administrator generated RSA keys in both rhel5 & fedora machines.In rhel5 (ip 192.168.0.88) fc9 (ip 192.168.0.29) recently i've changed rhel5 system ip 192.168.0.88 to 192.168.0.22, fc 9 ip changed to 192.168.0.29 to 192.168.0.217. In my lan no one is using 192.168.0.217 IP. That's why the reason i assigned that ip to fc9. Now in my system ip is 192.168.0.28, Now i was unable to login through ssh to 192.168.0.29.so again i changed it to 192.168.0.29 to 192.168.0.88 even then also i was unable to ssh to 88 machines from 28.

#ssh admin@192.168.0.88
ssh: connect to host 192.168.0.88 port 22: Connection refused.

# rpm -q telnet-server
telnet-server-0.17-38.el5
# vi /etc/xinet.d/telnet
disable = no

Then # service xinetd restart
# iptables -I INPUT -p tcp --dport 23 -j ACCEPT

# service iptables save

# service iptables restart

Just give following command and make sure that rule is saved.
# iptables -L

when i run the telnet command i was getting the following error.

#telnet ev1@192.168.0.88
ev1@192.168.0.88/telnet: Name or service not known

I enabled ip tables. This process i've done in both rhel5 systems. can any one suggest me how can i login through ssh & telnet.
 
Old 01-04-2010, 11:16 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
I could be wrong, but I thought telnet syntax was
Code:
telnet -l ev1 192.168.0.88
Also, for ssh, are you sure port 22 is open?

Evo2.
 
Old 01-04-2010, 11:21 PM   #3
ramesh14
Member
 
Registered: Apr 2008
Location: Hyderabad
Distribution: RHEL5,Fedora 8/9
Posts: 119

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Hi,

Now i was able to login through telnet.but not through ssh port 22 is open.

Thanks for the message.

can you suggest how to login through ssh.
 
Old 01-04-2010, 11:30 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Try using "ssh -vv <server>" to log in. Determine from these results and the servers logs why the connection is being refused.

Check the "known_hosts" and "authorized_keys" files. If they refer to the IP address of the server or client, the entries won't match.
Also check /etc/ssh/sshd_config. An "AllowUsers" entry like "user@<IP_ADDRESS> may not match.

Check the /etc/hosts files. If they have old entries, the IP numbers won't match the names. An entry in AllowUsers like "user@host" may fail where an entry "user@host.domain will succeed a reverse lookup.

Also check that the permissions of the .ssh directories or the users' home directories aren't too permissive.
 
Old 01-05-2010, 12:03 AM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
In addition to jschiwal's suggestion of using 'ssh -vvv', if you have access to the server logs, you'll probably get some useful information. If not, or if that does not help, try running a separate instance of the ssh server in debug mode (sshd -d): that will give a whole slew of information when you try to ssh to it.

Evo2.
 
Old 01-06-2010, 11:48 PM   #6
ramesh14
Member
 
Registered: Apr 2008
Location: Hyderabad
Distribution: RHEL5,Fedora 8/9
Posts: 119

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Hi

when i was trying with following commands to login through ssh to my local machine remotely i was getting the following errors.

#ssh -vvv 192.168.0.88
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.88 [192.168.0.88] port 22.
debug1: connect to address 192.168.0.88 port 22: Connection refused
ssh: connect to host 192.168.0.88 port 22: Connection refused

#sudo vi /etc/ssh/sshd_config (here in this command Allow Users entry is not entered).

And even i've checked out permissions of the .ssh directories. with telnet with the above given command (telnet -l ev1 192.168.0.88) its working,but not the ssh.

suggession will be highly appreciated.

Thanks in advance.
 
Old 01-06-2010, 11:53 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
debug1: connect to address 192.168.0.88 port 22: Connection refused
Are you *really* sure port 22 is open?

Did you check /etc/hosts.allow and /etc/hosts.deny on the server?

Evo2.
 
Old 01-06-2010, 11:55 PM   #8
ramesh14
Member
 
Registered: Apr 2008
Location: Hyderabad
Distribution: RHEL5,Fedora 8/9
Posts: 119

Original Poster
Blog Entries: 1

Rep: Reputation: 15
when i was trying to login with ssh -vv <server ip> i was getting the following errors.

#ssh -vv 192.168.0.88
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.88 [192.168.0.88] port 22.
debug1: connect to address 192.168.0.88 port 22: Connection refused
ssh: connect to host 192.168.0.88 port 22: Connection refused

Even i've checked out the entries in .ssh/known_hosts,/etc/hosts. In /etc/ssh/sshd_config its not showing any Allow Users entry. Now i was able to login through telnet (with telnet -l ev1 192.168.0.88) but not through ssh.

Regards,

Ramesh.
 
Old 01-06-2010, 11:59 PM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
So what did /etc/hosts.allow and /etc/hosts.deny have in them?

Also, can you "ssh localhost" after having telneted to the sever?

Have you checked server logs like I suggested in post #5?

Evo2.
 
  


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
SSH Problem - Can't login using Hostname, can login using ip address jqweezy Linux - Networking 7 01-26-2009 02:21 PM
can not login by SSH rajendrapoudel Linux - Server 9 09-18-2008 09:09 PM
SSH login veeruk101 Linux - Newbie 12 03-14-2006 09:17 AM
SSH Login | Need help !! xedios Linux - Software 0 12-21-2004 12:16 PM
ftp login -- ssh no login waffe Linux - General 4 12-27-2003 12:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:14 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
Open Source Consulting | Domain Registration