connect to host 192.168.0.7 port 22: Connection refused - Mandriva

This is a discussion on connect to host 192.168.0.7 port 22: Connection refused - Mandriva ; On Sun, 17 Aug 2008 17:53:31 +0000, Bit Twister wrote: > I can recommend commenting out the sshd line in > /etc/hosts.allow service xinetd reload and try again. Tried that ("allow service xinetd reload") but ssh from laptop still failed ...

+ Reply to Thread
Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast
Results 21 to 40 of 99

Thread: connect to host 192.168.0.7 port 22: Connection refused

  1. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 17:53:31 +0000, Bit Twister wrote:

    > I can recommend commenting out the sshd line in
    > /etc/hosts.allow service xinetd reload and try again.


    Tried that ("allow service xinetd reload") but ssh from
    laptop still failed as before.

    As the desktop ssh self-call seemed to work, is it possible
    something is awry on the laptop?

    The fact that it's ssh reports Port 22 refusal to connect does
    show that ssh is working, doesn't it?

    --
    /\/\aurice
    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  2. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 19:31:46 +0100, Maurice Batey wrote:

    > Virtualbox 1.5.6


    Are the ssh/sshd systems real or virtual?


  3. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 18:43:30 +0000, Bit Twister wrote:

    > I assume all test shots are not trying to ssh root@where


    No - "ssh mab@MABsdesktop"

    --
    /\/\aurice
    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  4. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 19:45:18 +0100, Maurice Batey wrote:
    >
    > Tried that ("allow service xinetd reload") but ssh from


    But did you Comment out sshd in /etc/hosts.allow?


    It is odd, xinetd is installed but sshd-xinetd did not show up in
    chkconfig --list | grep ssh
    sshd 0ff 1ff 2n 3n 4n 5n 6ff
    sshd-xinetd: off

    Guessing /etc/xinetd.d/sshd-xinetd is not there.
    Should have been installed when you installed the server package.

    $ rpm -q -f /etc/xinetd.d/sshd-xinetd
    openssh-server-4.7p1-2.3mdv2008.0

    I am not happy that you do not have /etc/xinetd.d/sshd-xinetd

    > As the desktop ssh self-call seemed to work, is it possible
    > something is awry on the laptop?


    Since you cannot connect, something is stopping it.

    > The fact that it's ssh reports Port 22 refusal to connect does
    > show that ssh is working, doesn't it?


    Yes, shows that ssh on the laptop is trying to connect.

    Verify ip address in laptop /etc/hosts matches
    hostname -i
    on desktop


  5. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 19:47:10 +0100, Maurice Batey wrote:
    > On Sun, 17 Aug 2008 18:43:30 +0000, Bit Twister wrote:
    >
    >> I assume all test shots are not trying to ssh root@where

    >
    > No - "ssh mab@MABsdesktop"


    groping around in the dark.

    do a hosthame -i on MABsdesktop

    and a ssh mab@the_above_ip_address_here



  6. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 19:02:49 +0000 (UTC), Bit Twister wrote:

    in ~mab on desktop do
    cd ~/.ssh
    chmod 700 .
    chmod 600 *
    cd

    and do the same on the laptop

    and run the test shot


  7. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 18:45:44 +0000, Bit Twister wrote:

    > Are the ssh/sshd systems real or virtual?


    Absolutely real! (Only WIndows stuff under VBox)

    --
    /\/\aurice
    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  8. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 19:02:49 +0000, Bit Twister wrote:

    > do a hosthame -i on MABsdesktop
    >
    > and a ssh mab@the_above_ip_address_here

    -------------------------------------------------------
    [mab@localhost ~]$ hostname -i
    127.0.0.1

    [mab@localhost ~]$ ssh mab@127.0.0.1
    Warning: Permanently added '127.0.0.1' (RSA) to the list of known
    hosts.
    mab@127.0.0.1's password:
    Last login: Sun Aug 17 18:25:23 2008 from localhost
    [mab@localhost ~]$ exit
    logout

    Connection to 127.0.0.1 closed.
    [mab@localhost ~]$
    ------------------------------------------------------







    --
    /\/\aurice
    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  9. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 22:23:42 +0100, Maurice Batey wrote:
    > On Sun, 17 Aug 2008 18:45:44 +0000, Bit Twister wrote:
    >
    >> Are the ssh/sshd systems real or virtual?

    >
    > Absolutely real! (Only WIndows stuff under VBox)


    You seem to missing/ignoring my questions in other replies,
    the ones ending in ?.

    Maybe, your just behind in answering them.
    Guess I'll wait and see.

  10. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 19:01:04 +0000, Bit Twister wrote:

    > But did you Comment out sshd in /etc/hosts.allow?


    Yes.
    >
    > $ rpm -q -f /etc/xinetd.d/sshd-xinetd

    openssh-server-4.7p1-2.3mdv2008.0
    --------------------------------------------------
    [mab@localhost ~]$ rpm -q -f /etc/xinetd.d/sshd-xinetd
    openssh-server-4.7p1-2.3mdv2008.0
    --------------------------------------------------
    >
    > Verify ip address in laptop /etc/hosts matches hostname -i
    > on desktop


    It does - both 127.0.0.1

    --
    /\/\aurice

    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  11. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 19:06:11 +0000, Bit Twister wrote:

    > in ~mab on desktop do
    > cd ~/.ssh
    > chmod 700 .
    > chmod 600 *
    > cd
    >
    > and do the same on the laptop


    OK on desktop, but laptop has no ~/.ssh directory anywhere.
    (And ssh from laptop still fails.)

    Have to close down now. 'night all...
    --
    /\/\aurice
    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  12. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 22:33:17 +0100, Maurice Batey wrote:
    > On Sun, 17 Aug 2008 19:01:04 +0000, Bit Twister wrote:
    >
    >> But did you Comment out sshd in /etc/hosts.allow?

    >
    > Yes.


    Good. I will suggest something like
    sshd: 192.168.0.3, 192.168.0.0/255.255.255.0

    for you final test.

    >>
    >> $ rpm -q -f /etc/xinetd.d/sshd-xinetd

    > openssh-server-4.7p1-2.3mdv2008.0
    > --------------------------------------------------
    > [mab@localhost ~]$ rpm -q -f /etc/xinetd.d/sshd-xinetd
    > openssh-server-4.7p1-2.3mdv2008.0
    > --------------------------------------------------


    Something went wrong because I expected sshd-xinetd
    to show up in your chkconfig --list | grep ssh

    Tell you what, bring up MCC and set On Boot for sshd.
    verify the other sshd is off/unchecked.
    and click Ok. Quit MCC and do a

    chkconfig --list | grep ssh

    sshd-xinetd should now show up.


    >> Verify ip address in laptop /etc/hosts matches hostname -i
    >> on desktop

    >
    > It does - both 127.0.0.1



    hmmm, ok, I had expected something like
    $ hostname -i
    192.168.0.2

    Because I assumed
    $ grep -i $(hostname -a) /etc/hosts
    192.168.0.2 desktop.mab.unregistered MABsdesktop
    would be found on the desktop. My bad.

    Let's ignore that for the moment:

    On MABsdesktop do a

    ifconfig
    and double check the nic connected to the laptop shows 192.168.0.2, then

    ssh mab@192.168.0.2
    and if it works;

    run
    ssh mab@192.168.0.2
    on the laptop

    Sleep tight.

  13. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 22:26:47 +0100, Maurice Batey wrote:


    > [mab@localhost ~]$ hostname -i
    > 127.0.0.1


    Heheh, just an FYI for the lurkers.


    [bittwister@pm80 ~]$ cat /etc/release
    Mandriva Linux release 2008.0 (Official) for i586

    [bittwister@pm80 ~]$ grep $(hostname) /etc/hosts
    192.168.1.213 pm80.home.test pm80

    [bittwister@pm80 ~]$ ssh $USER@127.0.0.1
    Last login: Sun Aug 17 19:29:09 2008 from localhost

    [bittwister@pm80 ~] exit
    Connection to 127.0.0.1 closed.




    [bittwister@wm81 ~]$ cat /etc/release
    Mandriva Linux release 2008.1 (Official) for i586

    [bittwister@wm81 ~]$ grep $(hostname) /etc/hosts
    192.168.1.131 wm81.home.test wm81

    [bittwister@wm81 ~]$ ssh $USER@127.0.0.1
    ssh_exchange_identification: Connection closed by remote host

    Snippet from /var/log/messages
    Aug 17 19:23:32 wm81 sshd[9895]:
    refused connect from localhost.localdomain (::ffff:127.0.0.1)


  14. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Mon, 18 Aug 2008 00:37:53 +0000 (UTC), Bit Twister wrote:

    bittwister wrote:
    > Snippet from /var/log/messages
    > Aug 17 19:23:32 wm81 sshd[9895]:
    > refused connect from localhost.localdomain (::ffff:127.0.0.1)


    Just a follow up. Rejection was caused because of hosts.allow did not
    catch it and let host.deny reject it.

    Thought hosts.allow should have let it through.

    ALL: LOCAL, .home.test

    #****** End of hosts.allow. ********

    Looking on pm80, I had to add wm81 ip address to hosts.allow
    for wm81 access.

    On wm81 (2008.1) None of the following worked
    sshd: .home.test
    sshd: .home.test, LOCAL, 192.168.1.131
    sshd: .home.test, LOCAL, 192.168.1.131, 192.168.1.0/24
    ALL: LOCAL, .home.test, 192.168.1.131, 192.168.1.0/24

    My host.allow solution for ssh $USER@127.0.0.1 on 2008.1 is

    ALL: LOCAL, .home.test, 27.0.0.1

    2008.0 has
    ALL: LOCAL, .home.test, 192.168.1.131, 192.168.1.0/24

    Gotta love the increase in security.

  15. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Mon, 18 Aug 2008 02:01:34 +0000 (UTC), Bit Twister wrote:
    > On Mon, 18 Aug 2008 00:37:53 +0000 (UTC), Bit Twister wrote:
    >
    > bittwister wrote:
    >> Snippet from /var/log/messages
    >> Aug 17 19:23:32 wm81 sshd[9895]:
    >> refused connect from localhost.localdomain (::ffff:127.0.0.1)

    >
    > Just a follow up. Rejection was caused because of hosts.allow did not
    > catch it and let host.deny reject it.
    >
    > Thought hosts.allow should have let it through.
    >
    > ALL: LOCAL, .home.test
    >
    > #****** End of hosts.allow. ********
    >
    > Looking on pm80, I had to add wm81 ip address to hosts.allow
    > for wm81 access.
    >
    > On wm81 (2008.1) None of the following worked
    > sshd: .home.test
    > sshd: .home.test, LOCAL, 192.168.1.131
    > sshd: .home.test, LOCAL, 192.168.1.131, 192.168.1.0/24
    > ALL: LOCAL, .home.test, 192.168.1.131, 192.168.1.0/24
    >
    > My host.allow solution for ssh $USER@127.0.0.1 on 2008.1 is
    >
    > ALL: LOCAL, .home.test, 27.0.0.1


    Opps, cut did not pick up 1, should read
    ALL: LOCAL, .home.test, 127.0.0.1

  16. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 21:27:58 +0000, Bit Twister wrote:

    > You seem to missing/ignoring my questions in other replies, the ones
    > ending in ?.


    Not deliberately, I can assure you!

    Will comb through and check. Watch this space... 8-))

    --
    /\/\aurice

    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  17. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Mon, 18 Aug 2008 15:24:10 +0100, Maurice Batey wrote:
    > On Sun, 17 Aug 2008 21:27:58 +0000, Bit Twister wrote:
    >
    >> You seem to missing/ignoring my questions in other replies, the ones
    >> ending in ?.

    >
    > Not deliberately, I can assure you!
    >
    > Will comb through and check. Watch this space... 8-))


    Tell you what, Instead of that, go through this and see what needs
    improvement and lets you run a check front to back.


    -------- standard debug ssh/sshd problem steps follows: ------------
    Version
    0.0

    The following is mainly for Mandriva, maybe Suse, maybe Redhat/Fedora and
    your install is not using SELinux/ACL's.

    I assume you have:
    o installed ALL system updates and have rebooted.
    o installed the sshd daemon/service package. (OpenSSH Server).
    o enabled it to run on boot.
    o started sshd on the server.

    In this document, "server" is where you are trying to ssh into and
    "client" is where you ssh from.

    Client is where ssh it trying to connect to sshd on the server.

    All ssh test shots will be to a user account on the server, not root.
    Where you see bittwister, or ~/, you should be in/using your user account.

    Some commands need root privileges to run. To create a root terminal,
    Click up a terminal,
    su - root or for the k/ubuntu crowd it would be
    sudo -i

    Anytime I am working a problem, I will open another root terminal and do a

    tail -f /var/log/messages
    on each system I am working with.

    I suggest you do the same.

    PS: To abort tail -f command, do a Control c
    To close a terminal/ssh session exit





    sshd has to running and/or enabled to run on the server.

    pgrep -lf sshd <===== Should return the pid and program name
    3866 /usr/sbin/sshd <============ see, sshd is running, pid=3866

    It might not be running if sshd is to run when needed.

    Do check the permissions on it

    ls -al /usr/sbin/sshd
    -rwxr-xr-x 1 root root 379292 2008-05-06 14:53 /usr/sbin/sshd


    chkconfig --list | grep sshd <====== on some systems
    sshd 0ff 1ff 2n 3n 4n 5n 6ff <= which run level starts on boot
    sshd-xinetd: off <=== on indicates to start when needed

    NOTE: Do not have both set on.

    Current run level found with
    /sbin/runlevel
    N 3 <==== indicates my system is set at 3 and 3n indicates
    sshd will be started on boot.

    If not running, you might be able to start it with
    service sshd start
    or maybe
    /etc/init.d/sshd start


    First prove you can connect to it by ip address when you are on the server

    ssh bittwister@$(hostname -i)

    If there is nothing in /etc/hosts.allow and /etc/hosts.deny
    I expect that to work.

    If fails, make sure your user account's .ssh directory has the correct
    permissions by doing:

    cd ~/.ssh
    chmod 700 .
    chmod 600 *
    cd

    ssh bittwister@$(hostname -i)

    If no message showed up in /var/log/messages and there is nothing in
    /etc/hosts.allow and /etc/hosts.deny I have no idea what to check next.

    man hosts.allow to understand lines not starting with #



    Next, run some test to prove network resolution is working.
    Test by node name with
    ssh bittwister@$(hostname --alias) then by fully qualified domain name
    ssh bittwister@$(hostname --fqdn)

    Failure on those, will be a /etc/hosts or network problem.
    If so, only use the server's ip address from your client until
    you get the network problem solved.

    Once that works, verify the hostname ip matches what the client sees.
    hostname -i on the server
    host servers_hostname_here on the client.

    If the hostname -i returns 127.0.0.1 on the server,
    you need to use the ip address of the server's nic that
    is connected to the client.

    ifconfig to find the address. Snippet follows

    eth1 Link encap:Ethernet HWaddr 00:16:17:57:66:54
    inet addr:192.168.1.131 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::216:17ff:fe57:6654/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    the inet addr: field is ip4 ip address
    the inet6: field is the ip6 ip address.

    Verify the ip address test on server with
    ssh bittwister@servers_ip_here


    Once those run, only the firewall and /etc/hosts.allow and hosts.deny
    contents would block incoming ssh attempts on the server.

    You open the Mandriva firewall with
    shorewall clear

    Before doing that, get the server ip address for the nic connected to
    the client.
    ifconfig should give you a list of running nics.

    hostname -i on the server.

    assuming server is not blocking pings, verify connection with
    ping -c1 servers_ip_here on the client, if works then
    bittwister@servers_ip_here on the client.
    if fails, hit up arrow

    and open the firewall on the server with
    shorewall clear
    hit a carriage return on the client to run the ssh client to server
    test shot again.

    No matter what, quickly enable the firewall, with
    service shorewall restart
    or shorewall restart
    on the server.

    If no messages in /var/log/messages on the server and hosts.allow and
    hosts.deny are empty. I do not know what the problem is.


    If all the above seems to be true, you will need to dump your settings
    so we can see them. Run the commands on server and client.
    Cut the command and results and paste them in your reply.


    hostname
    hostname -fqdn
    hostname -i
    cat /etc/hosts
    grep -v \# /etc/hosts.allow
    grep -v \# /etc/hosts.deny
    ifconfig

    If you see repeatable error messages in the tail -f terminals
    every time you do the ssh command, we need to see those also.

    Would not hurt to provide results from doing something like
    ssh -v bittwister@servers_ip_here
    or ssh -vv bittwister@servers_ip_here
    or ssh -vvv bittwister@servers_ip_here
    which will give increasing debug information with each v.
    Take a look at each and decide which one might help us.

    PS:
    If you run with /etc/hosts.allow and hosts.deny, I found
    it helpful for /etc/hosts.deny to contain


    ALL: ALL:\
    spawn ( \
    /bin/echo -e "\n\
    TCP Wrappers\: Connection Refused\n\
    By\: $(uname -n)\n\
    Process\: %d (pid %p)\n\
    \n\
    User\: %u\n\
    Host\: %c\n\
    Date\: $(date)\n\
    " | /bin/mail -s \"$(uname -n)\" root ) & : DENY

    #*********************** end host.deny ********************************

    That will send an email to root any time something gets through hosts.allow
    without being allowed.

    Example email follows:.

    TCP Wrappers: Connection Refused
    By: wm81.home.test
    Process: sshd (pid 11046)

    User: unknown
    Host: localhost.localdomain
    Date: Sun Aug 17 20:50:41 CDT 2008



    I have postfix installed, so I modified aliases to send any mail
    to root to me.

    tail -11 /etc/postfix/aliases | head -5

    # Person who should get root's mail. This alias
    # must exist.
    # CHANGE THIS LINE to an account of a HUMAN
    root: bittwister

    And executed:
    postalias aliases


    Once postfix is restarted, all mail to root (security alerts, cron job
    failures, audit failures,...) automagically shows up in my email box.


  18. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Sun, 17 Aug 2008 22:33:37 +0000, Bit Twister wrote:

    > I will suggest something like
    > sshd: 192.168.0.3, 192.168.0.0/255.255.255.0
    >
    > for you final test.


    Tried that (see below). Still no go from laptop.

    Here is what is in /etc/hosts, by the way:
    ----------------------------------------------------
    127.0.0.1 localhost
    192.168.0.1 router.mab.unregistered MABsrouter
    192.168.0.2 desktop.mab.unregistered MABsdesktop
    192.168.0.3 laptop.mab.unregistered MABslaptop
    ---------------------------------------------------

    and non-descriptive entries in /etc/hosts.allow:

    # sshd: 192.168.0.3/255.255.255.0
    # service xinetd reload
    # ALL: LOCAL, .mab.unregistered
    ALL:LOCAL,.mab.unregistered,192.168.0.3,
    192.168.0.0/255.255.255.0
    ----------------------------------------------------

    > Tell you what, bring up MCC and set On Boot for sshd. verify

    the other
    > sshd is off/unchecked. and click Ok. Quit MCC


    sshd was already running and set On Boot

    What do you mean by "Verify the other sshd is off/unchecked"?
    ================================================== ===========
    What other sshd?

    > On MABsdesktop do a ifconfig and double check the nic connected
    > to the laptop shows 192.168.0.2


    If you mean (under eth0) "inet=", it shows:
    inet addr:192.168.0.3
    which is the IP of the laptop.

    > Do ssh mab@192.168.0.2 on desktop


    I assume you meant to laptop, which is 192.169.0.3, so used
    latter and it did work - i.e. ssh connected to laptop.
    (That puzzles me, because sshd is not running on laptop...)

    > run ssh mab@192.168.0.2 on the laptop


    Did you mean ssh on laptop to itself? As above, did ssh to
    mab@192.168.0.3, and it did work (though no sshd on laptop).

    On laptop, ssh mab@MABsdesktop) still fails - see -vv output:

    --------------------------------------------------------
    [mab@localhost ~]$ ssh -vv mab@MABsdesktop
    OpenSSH_4.7p1, OpenSSL 0.9.8f 11 Oct 2007
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to MABsdesktop [192.168.0.2] port 22.
    debug1: connect to address 192.168.0.2 port 22: Connection
    refused
    ssh: connect to host MABsdesktop port 22: Connection refused
    [mab@localhost ~]$
    --------------------------------------------------------

    The annoying thing is that - last year, when still using MDV
    2007 on desktop and Vista on laptop - I could do ssh via Putty on
    Vista!

    Presumably this is not a router firewall problem. (Although it
    does have an SSH blocker, I believe that only applies to traffic
    coming from the outside 'net. Anyway, I tried turning the
    blocker off - no difference (so turned it back on.))

    Thanks for sticking with me, BT - much appreciated!
    I keep thinking we're just one step away from cracking this...

    Anything else I can do to help get there?

    --
    /\/\aurice
    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


  19. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Mon, 18 Aug 2008 16:18:36 +0100, Maurice Batey wrote:
    > On Sun, 17 Aug 2008 22:33:37 +0000, Bit Twister wrote:
    >
    >> I will suggest something like
    >> sshd: 192.168.0.3, 192.168.0.0/255.255.255.0
    >>
    >> for you final test.

    >
    > Tried that (see below). Still no go from laptop.


    After playing around last night, I can now suggest just

    ALL: .mab.unregistered, 192.168.0.

    Until we can get ssh working from the laptop,
    I wish you would not have any commands in hosts.allow and hosts.deny

    > Here is what is in /etc/hosts, by the way:
    > ----------------------------------------------------
    > 127.0.0.1 localhost
    > 192.168.0.1 router.mab.unregistered MABsrouter
    > 192.168.0.2 desktop.mab.unregistered MABsdesktop
    > 192.168.0.3 laptop.mab.unregistered MABslaptop
    > ---------------------------------------------------


    Which /etc/hosts file. With that hosts file,
    you can have the same hosts file on both machines.

    Just for fun, I want to make the hosts file the same
    on both machines and looks as follows:

    127.0.0.1 localhost
    192.168.0.1 router.mab.unregistered router
    192.168.0.2 desktop.mab.unregistered desktop
    192.168.0.3 laptop.mab.unregistered laptop



    >
    > and non-descriptive entries in /etc/hosts.allow:
    >
    > # sshd: 192.168.0.3/255.255.255.0
    > # service xinetd reload
    > # ALL: LOCAL, .mab.unregistered
    > ALL:LOCAL,.mab.unregistered,192.168.0.3,
    > 192.168.0.0/255.255.255.0
    > ----------------------------------------------------


    Until we can get ssh working from the laptop,
    I wish you would not have any commands in hosts.allow and hosts.deny
    on either machine.

    >
    >> Tell you what, bring up MCC and set On Boot for sshd. verify

    > the other
    >> sshd is off/unchecked. and click Ok. Quit MCC

    >
    > sshd was already running and set On Boot
    >
    > What do you mean by "Verify the other sshd is off/unchecked"?
    > ================================================== ===========
    > What other sshd?


    In both 2008.0 and 2008.1 MCC System Services I have two lines/selections
    sshd running [Info] [x] On Boot Start Stop
    sshd-xinetd [Info] [ ] Start when Requested Start Stop

    If you are missing sshd-xinetd, I have no idea why you are missing
    /etc/xinetd.d/sshd-xinetd

    $ ls -al /etc/xinetd.d/sshd-xinetd
    -rw-r--r-- 1 root root 321 2008-05-06 14:53 /etc/xinetd.d/sshd-xinetd

    You have shown me it was in the rpm in an earlier post.


    >> On MABsdesktop do a ifconfig and double check the nic connected
    >> to the laptop shows 192.168.0.2

    >
    > If you mean (under eth0) "inet=", it shows:
    > inet addr:192.168.0.3
    > which is the IP of the laptop.


    Well, there you have it. Your settings in /etc/hosts and
    what is configured for the nic are incorrect.

    You have to make ip address in /etc/hosts match what is
    in /etc/sysconfig/network-scripts/ifcfg-eth0's IPADDRESS
    from each machine.


    >
    >> Do ssh mab@192.168.0.2 on desktop

    >
    > I assume you meant to laptop,


    No assuming, as I mis-understood it, 192.168.0.2 is the desktop
    running sshd.

    So, I want to verify you can connect to the desktop from the desktop
    with the desktop's ip address.
    ip given as commands were what you told me was the ip for the desktop.

    Numbers were before you told me about you ipconfig results on desktop.

    >
    > Presumably this is not a router firewall problem.


    Nope, just involves two machines and their connection.

    > (Although it
    > does have an SSH blocker, I believe that only applies to traffic
    > coming from the outside 'net.


    Sounds about right.


    > Anyway, I tried turning the
    > blocker off - no difference (so turned it back on.))


    Outstanding.


    > Thanks for sticking with me, BT - much appreciated!
    > I keep thinking we're just one step away from cracking this...


    Good for you. I was about one step away from giving up.

    > Anything else I can do to help get there?


    First, get the ip addresses in /etc/hosts matching what you
    find in the nics which connect to each machine.

    Fix /etc/hosts on all machines.

    Then go through the trouble shooting text provided in another
    post and see if you understand/agree with what is checking doing
    and your problem is fixed.


  20. Re: connect to host 192.168.0.7 port 22: Connection refused

    On Mon, 18 Aug 2008 14:29:07 +0000, Bit Twister wrote:

    > -------- standard debug ssh/sshd problem steps follows:


    > I assume you have:
    > o installed ALL system updates and have rebooted.
    > o installed the sshd daemon/service package. (OpenSSH Server)
    > o enabled it to run on boot.
    > o started sshd on the server.


    Yes.
    >
    > pgrep -lf sshd <===== Should return the pid and

    program
    > name 3866 /usr/sbin/sshd <============ see, sshd is running,
    > pid=3866


    Yes (though no sign of "pid=xxxx")

    >
    > It might not be running if sshd is to run when needed.
    >
    > Do check the permissions on it
    >
    > ls -al /usr/sbin/sshd
    > -rwxr-xr-x 1 root root 379292 2008-05-06 14:53 /usr/sbin/sshd


    Yes - same
    >
    > chkconfig --list | grep sshd <====== on some

    systems sshd
    > 0ff 1ff 2n 3n 4n 5n 6ff <= which run level starts on boot
    > sshd-xinetd: off <=== on indicates to start when
    > needed


    OK - except still no sign of "sshd-xinetd..."
    =============================
    >
    > Current run level found with
    > /sbin/runlevel
    > N 3 <==== indicates my system is set at 3 and 3n
    > indicates
    > sshd will be started on boot.


    Yes - that's OK
    >
    > First prove you can connect to it by ip address when you are on

    the server
    >
    > ssh bittwister@$(hostname -i)


    Fine.

    > ssh bittwister@$(hostname --alias)


    Failed:
    ------------------------------------------------
    [mab@localhost ~]$ ssh mab@$(hostname --alias)
    ssh: : Name or service not known
    ------------------------------------------------

    then by fully qualified
    domain name
    > ssh bittwister@$(hostname --fqdn)


    Fine.
    >
    > Once that works, verify the hostname ip matches what the client

    sees.
    > hostname -i on the server host servers_hostname_here on
    > the client.


    'hostname -i' gives 127.0.0.1,
    >
    > If the hostname -i returns 127.0.0.1 on the server, you need to use the ip
    > address of the server's nic that is connected to the client.


    I believe that is 192.168.0.2 in my case: cat /etc/hosts gives

    127.0.0.1 localhost
    192.168.0.1 router.mab.unregistered MABsrouter
    192.168.0.2 desktop.mab.unregistered MABsdesktop
    192.168.0.3 laptop.mab.unregistered MABslaptop

    >
    > ifconfig to find the address.

    In my case:
    -----------------------------------------------------------
    eth0 Link encap:Ethernet HWaddr 00:1B:21:07:31:63
    inet addr:192.168.0.3 Bcast:192.168.0.255
    Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    ------------------------------------------------------------
    >
    > Verify the ip address test on server with
    > ssh bittwister@servers_ip_here


    You mean - on server - ssh to itself? This is what happens:

    ------------------------------------------------------------
    [mab@localhost ~]$ ssh mab@192.168.0.2
    ssh: connect to host 192.168.0.2 port 22: Connection refused
    ------------------------------------------------------------
    (though ssh mab@127.0.0.1 and ssh mab@(hostname) work)


    I'll stop here, as my earoier posting today may have helped
    clear the air.

    --
    /\/\aurice
    Linux Mandriva 2.6.22.19-desktop-2mdv 2008.0 PP 32-bit
    KDE 3.5.7 Virtualbox 1.5.6
    (Remove 'removethis.' to reply by email)


+ Reply to Thread
Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast