LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 10-23-2007, 09:02 AM   #1
lene
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Rep: Reputation: 0
SSH connection in Fedora 6


Good afternoon,
My problem consists in following:
I want to enable passwordless ssh connection between 2 computers in one domain.
when i try to execute ssh xx.xx.xx.xx on Host 1 to Host 2
im able to log in
but the same command doesn't work when i try to connect from Host2 to Host 1
The responce i get is
ssh: connect to host xx.xx.xx.xx port 22: Connection timed out

Firewalls are disabled on both
Please, can somebody help?
 
Old 10-23-2007, 09:26 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
is ssh running on the destination machine?
 
Old 10-23-2007, 10:17 AM   #3
shafty023
Member
 
Registered: Oct 2007
Distribution: OSX
Posts: 248

Rep: Reputation: 31
Yes please verify you have ssh enabled on the destination machine. Just b/c you can connect from Host1 to Host2, does not mean the reverse if Host1 does not have sshd running. You can run "sudo /etc/init.d/sshd restart" without quotes to start it up. You'll also need to make sure you have public key authentication enabled on both hosts in /etc/ssh/sshd_config

#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

Then make sure you have the public key from each host saved in ~/.ssh/authorized_keys. The directory .ssh must have permissions 700 or it will not work. Let me know if you have any questions
 
Old 10-23-2007, 10:22 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well hang on, no one is talking about PSK's yet... it times out, therefore there is nothing listening on that socket, and authentication mechanisms are not relevant yet. tackle one problem at a time.
 
Old 10-23-2007, 02:55 PM   #5
shafty023
Member
 
Registered: Oct 2007
Distribution: OSX
Posts: 248

Rep: Reputation: 31
I agree you with you acid, I jumped the gun a little but figured I'd leave the information posted here in case no one else knew about it and I didn't get a chance to reply later on.
 
Old 10-24-2007, 02:21 AM   #6
lene
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for such a prompt reply
but stop stop stop not so fast

the problems started when i installed the fedora 7 on the host 1.
So i have fedora 7 on host 1 and fedora 6 on host 2.
Im not proficient in security questions except for general information and instructions.
before instalation these two computers were having passwordless ssh connection.
so i can connect via ssh from host 2 (F6) to host 1 (f7)
but i cant connect from host 1 to host 2 : connection time out


so im not so smart i need very simple explanations

i checked
/etc/ssh/sshd_config

#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

This record is the same, but i think i do something wrong with keys ?
first i generate the key with command
on both hosts i perform :
# service iptables stop to turn of firewalls
then
# service sshd start
then generate the key
# ssh -keygen -t dsa

when i do have the following:
scp file1.pub root@host1:/tmp/file1-host2.pub
cat file1 -file1.pub >> .ssh/authorized_keys
chmod 400 .ssh/authorized_keys
ssh -i file1 host1

am i right or?

Thanks
 
Old 10-24-2007, 02:24 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
as above, this is nothign to do with keys or anything. is sshd actually running? check the output of "ps aux". is there a firewall blocking access? check the output of "iptables -L"
 
Old 10-24-2007, 02:33 AM   #8
lene
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
yes i checked the output of iptables -L is
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination

and i also run ps aux | grep ssh
and there is smth like /usr/bin/sshd running

so what is next instruction?

Thanks
 
Old 10-24-2007, 02:34 AM   #9
lene
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
yes i checked the output of iptables -L is
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination

and i also run ps aux | grep ssh
and there is smth like /usr/bin/sshd running

so what is next instruction?

Thanks
 
Old 10-24-2007, 02:46 AM   #10
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
Check the log files too for any errors [amybe ssh dir permissions are too liberal or something like that].

/var/log/messages
/var/log/secure
 
Old 10-24-2007, 02:55 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
have you even got the right IP address? can you ping it?
 
Old 10-24-2007, 02:55 AM   #12
lene
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
There is only one type of error discovered :

Oct 24 09:46:19 localhost sshd[2416]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
 
Old 10-24-2007, 03:17 AM   #13
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
could that be an issue ?
See if some other service is using port 22.

/usr/sbin/lsof -i | grep 22

The left corner should give u the service using the port.
Check the log files of the other host as well.
 
Old 10-24-2007, 03:29 AM   #14
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
no, sshd is clearly already running, the ps proves it. as above, can you ping the box at all?
 
Old 10-24-2007, 04:02 AM   #15
lene
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
[root@localhost ~]# /usr/sbin/lsof -i | grep 22
hpiod 2385 root 0u IPv4 8458 TCP localhost.localdomain:2208 (LISTEN)
python 2390 root 4u IPv4 8474 TCP localhost.localdomain:2207 (LISTEN)
firefox-b 4026 root 33u IPv4 22478 TCP 192.168.19.125:41459->nf-in-f104.google.com:http (ESTABLISHED)
firefox-b 4026 root 37u IPv4 22487 TCP 192.168.19.125:43357->nf-in-f103.google.com:http (ESTABLISHED)
firefox-b 4026 root 42u IPv4 22550 TCP 192.168.19.125:42807->kr-in-f165.google.com:http (ESTABLISHED)
firefox-b 4026 root 43u IPv4 22554 TCP 192.168.19.125:42808->kr-in-f165.google.com:http (ESTABLISHED)
[root@localhost ~]#


this network is configured manualy and has static ip.
two computers are interconnected via router and switch.
im able to ping in both sides, and login via ssh from host 2 to host 1 but not otherwise!

Last edited by lene; 10-24-2007 at 05:26 AM.
 
  


Reply

Tags
ssh


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
ssh: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 06:15 AM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
Internet connection timeout on Fedora Core 5 using USB connection mike1111 Linux - Networking 0 07-23-2006 09:44 PM
wireless connection ok with knoppix dvd , no connection with installed fedora 4 docharmony Linux - Wireless Networking 2 11-27-2005 04:33 PM
ssh in fedora: connection refused zwanzig Linux - Networking 8 06-11-2004 04:26 AM


All times are GMT -5. The time now is 11:48 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration