LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 12-26-2012, 03:30 AM   #1
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Rep: Reputation: 0
Red face BackTrack -- SSH Help


Hi,

I'm using bt 5 R3.

Properly worked ssh without errors in last few months.But suddenly ssh not start and unable to connect via putty.
There is no err messages in /var/log/messages.
Regenerate ssh keys and try to restart ssh.No error shown.
Firewall already off.

When try to connect via ssh (From console) it gave error "Connection refused on port 22"

I try to reinstall openssh (apt-get install openssh-server)but it give errors.No idea to rectify this issue.

Please help ....!

Thanks,
Prabhath
 
Old 12-26-2012, 03:54 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by pra838 View Post
...
When try to connect via ssh (From console) it gave error "Connection refused on port 22"
...
Most likely the port is not open. Probably sshd is not running or your machine is no longer recognizes by sshd. This could happen (depending on the configuration) for example if the ip-adress (of the client) has changed.

Markus
 
Old 12-26-2012, 04:33 AM   #3
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Original Poster
Rep: Reputation: 0
Yes ssh not running now.There is no way to start that.I did followings.

/etc/init.d/ssh stop/start/restart ----> no any out puts
service ssh stop/start/restart ----> not recognize as service
ssh stop/start/restart --->no any out puts

ps -ef | grep ssh

ssh is not running ....!

ufw status ----> inactive

Oh..... my god, how to resolve this issue....!


Help plz............................................................!
 
Old 12-26-2012, 04:39 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
What does
Code:
which sshd
say? What is inside of /etc/init.d/ ?

BTW, the program is sshd not ssh! it's a daemon.

And as you know, you'll have to check for the running sshd daemon on the server, not the client, the client is the machine where you execute the ssh command.

Markus
 
Old 12-26-2012, 04:54 AM   #5
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Original Poster
Rep: Reputation: 0
#which ssh
/usr/bin/ssh


using backtrack and previously used /etc/init.d/ssh stop/start --- work fine during last 3 months

cd /etc/init.d
ls
ssh
 
Old 12-26-2012, 05:03 AM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
You should check your configuration. And read my previous posting again and don't confuse ssh and sshd.

Markus
 
Old 12-26-2012, 08:43 AM   #7
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Original Poster
Rep: Reputation: 0
backtrack support graphical mode to start ssh.If start graphically ssh,the terminal open and says ssh is running.But when I start it from graphical, terminal open and not shown any messages and ssh is not running.

As my view is ssh corrupted and I need to reinstall it. But below command not working my bt5r3 box.

apt-get remove openssh-server
apt-get remove openssh-client
apt-get remove ssh


Please help me to reinstall the SSH.

Thanks....!
Prabhath
 
Old 01-02-2013, 02:17 AM   #8
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Original Poster
Rep: Reputation: 0
Problem is still there ....!
No help found.
Please help.
 
Old 01-02-2013, 02:18 AM   #9
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Original Poster
Rep: Reputation: 0
Talking

Quote:
Originally Posted by markush View Post
You should check your configuration. And read my previous posting again and don't confuse ssh and sshd.

Markus



Markus,

As my view, u r not familiar Backtrack.
 
Old 01-02-2013, 06:17 AM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by pra838 View Post
I try to reinstall openssh (apt-get install openssh-server)but it give errors.No idea to rectify this issue.
Would help to know which errors, we are neither mind readers nor sitting in front of your machine.
 
Old 01-03-2013, 01:11 AM   #11
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Original Poster
Rep: Reputation: 0
When tarring to connect the machine using PUTTY,Gave connection refused.
Or logging from console and type ssh root@localhost then gave connection refused.
No any errors in /var/log/messages or any other logs.


#########################################################

root@bt:~# cat /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
#Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
UseDNS no
#
#
#ServerAliveInterval 60
root@bt:~#
 
Old 01-03-2013, 01:42 AM   #12
theFreethinker
LQ Newbie
 
Registered: Jul 2011
Location: Tartu, Estonia
Distribution: Ubuntu
Posts: 17

Rep: Reputation: Disabled
Have you tried 'ssh -v'? What's the error message you get?

You can check with 'lsof -i' is sshd (or something else) listening on port 22. The output should be like

Code:
COMMAND  PID    USER   FD  TYPE   DEVICE   SIZE/OFF   NODE   NAME
sshd     1048   root   3u  IPv4   8695     0t0        TCP    *:ssh (LISTEN)
 
Old 01-03-2013, 05:52 AM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
You sayed that you get errors when you try to re-install ssh, which errors are these?
Please use code-tags (see my signature) for output of commands and contents of text-files.
 
Old 01-04-2013, 02:17 AM   #14
pra838
Member
 
Registered: Feb 2010
Location: Sri Lanka
Posts: 50

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by theFreethinker View Post
Have you tried 'ssh -v'? What's the error message you get?

You can check with 'lsof -i' is sshd (or something else) listening on port 22. The output should be like

Code:
COMMAND  PID    USER   FD  TYPE   DEVICE   SIZE/OFF   NODE   NAME
sshd     1048   root   3u  IPv4   8695     0t0        TCP    *:ssh (LISTEN)


Please find below details.....!

root@bt:~# lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
postgres 759 postgres 3u IPv6 8246 0t0 TCP localhostostgresql (LISTEN)
postgres 759 postgres 6u IPv4 8247 0t0 TCP localhostostgresql (LISTEN)
postgres 759 postgres 8u IPv6 8256 0t0 UDP localhost:34257->localhost:34257
postgres 764 postgres 8u IPv6 8256 0t0 UDP localhost:34257->localhost:34257
postgres 765 postgres 8u IPv6 8256 0t0 UDP localhost:34257->localhost:34257
postgres 766 postgres 8u IPv6 8256 0t0 UDP localhost:34257->localhost:34257
postgres 767 postgres 8u IPv6 8256 0t0 UDP localhost:34257->localhost:34257
postgres. 861 postgres 3u IPv6 8469 0t0 TCP localhost:7337 (LISTEN)
postgres. 861 postgres 4u IPv4 8470 0t0 TCP localhost:7337 (LISTEN)
postgres. 861 postgres 6u IPv6 8476 0t0 UDP localhost:59808->localhost:59808
postgres. 870 postgres 6u IPv6 8476 0t0 UDP localhost:59808->localhost:59808
postgres. 871 postgres 6u IPv6 8476 0t0 UDP localhost:59808->localhost:59808
postgres. 872 postgres 6u IPv6 8476 0t0 UDP localhost:59808->localhost:59808
postgres. 873 postgres 6u IPv6 8476 0t0 UDP localhost:59808->localhost:59808
root@bt:~#

root@bt:~# ssh -v root@localhost
OpenSSH_5.3p1 Debian-3ubuntu6, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [::1] port 22.
debug1: connect to address ::1 port 22: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused
root@bt:~#


No ssh is running and can not start ssh.
 
Old 01-04-2013, 03:07 AM   #15
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
What is the output of these commands:

Code:
/etc/init.d/ssh start
ps $(pidof sshd)
fuser -n tcp 22
 
  


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
Error when connecting to backtrack with ssh C3phalex1n_0x Linux - Newbie 1 12-13-2012 10:07 AM
Help with Backtrack elites5 Linux - Distributions 1 03-14-2011 12:02 AM
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
backtrack deleted08 Linux - Newbie 4 12-14-2006 05:41 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM

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

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