cancel
Showing results for 
Search instead for 
Did you mean: 
Chetan_Tiwary_
Community Manager
Community Manager
  • 638 Views

Red Hat Linux Interview Series 3

Q.) How to troubleshoot the below ssh error :

ssh: connect to host servera.example.com: Connection refused

 

Q.)  Explain the situation and how to remove this daemon process :

[root@rhel9]:~# ps aux |grep myscriptd
 1052 root      0 Z    [myscriptd] 
[root@rhel9]:~# kill -9 1052 
[root@rhel9]:~# ps aux |grep myscriptd 
 1052 root      0 Z    [myscriptd]

 

Q.) How will you troubleshoot this issue :Screenshot from 2024-09-13 22-33-49.png

 

I'll be posting a series of Linux-related questions covering various skill levels. Feel free to share your insights and expertise. Your contributions will benefit learners at all stages, from those in current roles to those preparing for Linux interviews.

1 Reply
Trevor
Starfighter Starfighter
Starfighter
  • 609 Views

That first question will be the easiest for me to respond to - not because it's simple,
but because I'm going to "cheat" a little bit in what I'm going to use as a procedure
to troubleshoot the issue.

Again, the question is:  

How to troubleshoot the below ssh error :

        ssh: connect to host servera.example.com: Connection refused


Well, one of the things I would begin with on the client, would be to include a healthy
does of v's in my ssh command:

             ssh  -vvv  servera.example.com

The -v switch uses the "Verbose" mode of the ssh client - essentially causing
ssh to print debugging messages about its progress while attempting to connect
to the remote service. This is most helpful in debugging connection, authentication,
and configuration problems.  How nice that this will help in debugging connection
issues, because that's exactly the issue that we're having in the question:
Connection refused

Note: When using the ssh command to launch the ssh client, mulitple -v options
increase the amount of information that will be output. The maximum number of
v's is 3 -- this is why I show -vvv in my command above.

There's a very good likelihood that the real work, to overcome this issue, will have
to be performed on the remote host/system.  If that's the case, you're in luck - and
this is where I cheat.  I say that because, now I'm going to point you in the direction
of a very well written post, that was authored by one of the Community Managers,
Chetan_Tiwary.  His post titled, "Troubleshooting - A scientific methodolgy" is one 
that should be a part of every Linux user's toolkit!!!!

In the post, Chetan is providing a procedure to troubleshoot a connection issue as
well.  The only difference with the issue in that post, and this post involving the ssh
connection issue, is:
1) the client being used to make the connection (ssh - this post   vs   curl - previous post)
2) the connection is initiated from a host that is different from the remote host (this post)
      vs the connection being made from, and to, the same system/host
Note:  This will make a lot more sense when you have a look at that previous posting
on troubleshooting methodology, and compare the commands that initiate those
connections.

So, what I've done in this post is to provide a little seasoning, with my suggestion of
adding -vvv to the ssh command, to the master recipe provided by Chetan's previous
post.  Of course, if you're responding to this question in an interview, you'll have to
be able to articulate the composite of both pieces - my contribution, along with Chetan's
post - and not cheat like I did

If you have not previously had a look at Chetan's previous post, I know you'll thank 
me for pointing you in that direction, rather than attempting to reinvent the wheel!!!

Thanks for reading!!!

Trevor "Red Hat Evangelist" Chandler
0 Kudos
Join the discussion
You must log in to join this conversation.