LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2013, 12:23 PM   #1
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
sshd debug mode


Hi All,

Server: CentOS 6.4 x86_64
Client: Ubuntu 13.04

I was trying SFTP Chroot Jail, and while doing so, i ran into some problems. So i wanted to debug ssh connection - to know why i am not able to connect? In the end, i solved the problem. But while searching internet on how to debug sshd, i came across many tutorials like this one 'How can I run Openssh daemon in debug mode?'.

But i am not getting any debug messages at all.

This is what i did: (Pls see attached ScreenShot)
  1. (Left-Top): On Server, issued command '/usr/sbin/sshd -p 12345 -D -d -e', to start ssh daemon in debug mode.
  2. (Left-Bottom): From client, ssh to server as wrong user and also as correct user. I was hoping that debug messages will scroll up on server monitor. But nothing happened... not even cursor moved.
  3. (Right): So, to verify, i opened /var/log/secure file, and everything seems fine. all the right noises are made.

What i'm doing wrong? Am i wrong that i am expecting some messages will scroll on server monitor in debug mode? Where are debug messages shown...

Any help will be much appreciated.

Thanks
Attached Thumbnails
Click image for larger version

Name:	sshd.png
Views:	182
Size:	139.1 KB
ID:	13613  
 
Old 10-03-2013, 12:30 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Looks to me like you forgot to specify the port in the ssh connection (-p 12345 on the ssh command)
 
Old 10-03-2013, 12:42 PM   #3
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Original Poster
Rep: Reputation: 153Reputation: 153
Quote:
Originally Posted by jpollard View Post
Looks to me like you forgot to specify the port in the ssh connection (-p 12345 on the ssh command)
I did try. but it throws error.
Code:
$ ssh -p 12345 madhu@cent
ssh: connect to host cent port 12345: No route to host

$ ssh -p 12345 madhu@192.168.1.50
ssh: connect to host 192.168.1.50 port 12345: No route to host
But if you look at '/var/log/secure' file (right-window), i'm getting response. all three windows are in real-time.
 
Old 10-03-2013, 03:24 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
IN the past, when I've done this, sshd does not log to anything but the terminal running sshd in the debug mode.

All the others are using the default port, therefore I would expect those are from the ssh without the port specification.

It is possible for a router/firewall to be blocking access to port 12345 (I have seen some reports where it happens).
 
1 members found this post helpful.
Old 10-03-2013, 03:32 PM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
+1 to jpollard's post; I had nearly the same exact issue arise on me about two weeks ago, and my firewall on my network was at fault the whole time. Tip: When you are using odd port numbers for ssh, remember to account for that in your firewall
 
1 members found this post helpful.
Old 10-03-2013, 03:56 PM   #6
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Original Poster
Rep: Reputation: 153Reputation: 153
Quote:
Originally Posted by jpollard View Post
It is possible for a router/firewall to be blocking access to port 12345 (I have seen some reports where it happens).
You hit the bull's-eye!!! As corp769 also mentioned, it was iptables blocking it. Stopped iptables to check - Bhoom... server teminal started talking...

Thanks-a-lot
Attached Thumbnails
Click image for larger version

Name:	sshd2-2.jpg
Views:	118
Size:	142.0 KB
ID:	13619  
 
Old 10-03-2013, 03:59 PM   #7
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
I'm actually quite happy I replied to that post! ... I forgot to finish that server, so I got up off my lazy @ss and finished it. Cheers?

And kudos on getting that working!
 
  


Reply


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
how to troubleshoot/debug sshd segfaults Phylum Linux - Software 4 01-06-2013 09:25 PM
[SOLVED] How to get Openssh sshd daemon debug information on Solaris 10? johncsl82 Solaris / OpenSolaris 3 09-01-2009 07:49 AM
How to find a library is compiled in debug mode or release mode babu198649 Linux - Newbie 1 05-26-2009 09:42 AM
xinetd in debug mode. kutty_prasad Linux - Enterprise 2 01-30-2008 03:32 AM
DHCP in debug mode lapthorn Linux - Networking 1 12-03-2003 07:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 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