# SSH service no work..  [SOLVED]

## KingYes

Hey all.

I installed the SSH service, and i see running on 'ps xa' list. But its no running.. i mean i can't connect to port 22 (or other port on /etc/ssh/config....).

How i can found my mistake ?

Thanks all.Last edited by KingYes on Sun Feb 10, 2008 2:48 am; edited 1 time in total

----------

## vad3r

Please paste the output from a ssh connection: ssh -vvvvv Your.IP.Address

----------

## KingYes

From 'ssh -vvvvv localhost' command:

```
OpenSSH_4.7p1, OpenSSL 0.9.8g 19 Oct 2007

debug1: Reading configuration data /etc/ssh/ssh_config

/etc/ssh/ssh_config: line 39: Bad configuration option: LoginGraceTime

/etc/ssh/ssh_config: line 40: Bad configuration option: PermitRootLogin

/etc/ssh/ssh_config: line 43: Bad configuration option: MaxAuthTries

/etc/ssh/ssh_config: line 63: Bad configuration option: PermitEmptyPasswords

/etc/ssh/ssh_config: line 88: Bad configuration option: UsePAM

/etc/ssh/ssh_config: line 91: Bad configuration option: AllowTcpForwarding

/etc/ssh/ssh_config: line 93: Bad configuration option: X11Forwarding

/etc/ssh/ssh_config: line 94: Bad configuration option: X11DisplayOffset

/etc/ssh/ssh_config: line 95: Bad configuration option: X11UseLocalhost

/etc/ssh/ssh_config: line 98: Bad configuration option: PrintMotd

/etc/ssh/ssh_config: line 107: Bad configuration option: UseDNS

/etc/ssh/ssh_config: line 116: Bad configuration option: Subsystem

/etc/ssh/ssh_config: line 117: Bad configuration option: AllowUsers

/etc/ssh/ssh_config: terminating, 13 bad configuration options
```

And, this is my config:

```
#   $OpenBSD: sshd_config,v 1.75 2007/03/19 01:01:29 djm Exp $

# This is the sshd server system-wide configuration file.  See

# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with

# OpenSSH is to specify options with their default value where

# possible, but leave them commented.  Uncommented options change a

# default value.

Port 22

#AddressFamily any

#ListenAddress 0.0.0.0

#ListenAddress ::

# Only allow protocol v2 connections

Protocol 2

# HostKey for protocol version 1

#HostKey /etc/ssh/ssh_host_key

# HostKeys for protocol version 2

#HostKey /etc/ssh/ssh_host_rsa_key

#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key

#KeyRegenerationInterval 1h

#ServerKeyBits 768

# Logging

# obsoletes QuietMode and FascistLogging

#SyslogFacility AUTH

#LogLevel INFO

# Authentication:

# Shouldn't take more than 30secs to type a password

LoginGraceTime 30

PermitRootLogin no

#StrictModes yes

# Pam takes presidence

MaxAuthTries 3

#RSAAuthentication yes

#PubkeyAuthentication yes

#AuthorizedKeysFile   .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts

#RhostsRSAAuthentication no

# similar for protocol version 2

#HostbasedAuthentication no

# Change to yes if you don't trust ~/.ssh/known_hosts for

# RhostsRSAAuthentication and HostbasedAuthentication

#IgnoreUserKnownHosts no

# Don't read the user's ~/.rhosts and ~/.shosts files

#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!

#PasswordAuthentication no

# Pam takes presidence

PermitEmptyPasswords no

# Change to no to disable s/key passwords

# Allow both PAM and this config (PAM first) & s/key passwords

ChallengeResponseAuthentication no

# Kerberos options

#KerberosAuthentication no

#KerberosOrLocalPasswd yes

#KerberosTicketCleanup yes

#KerberosGetAFSToken no

# GSSAPI options

#GSSAPIAuthentication no

#GSSAPICleanupCredentials yes

# 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

# Useful for securing VNC sessions

AllowTcpForwarding yes

#GatewayPorts no

X11Forwarding yes

X11DisplayOffset 10

X11UseLocalhost yes

# I usually put something really mean in /etc/motd or cron `fortune -s 150 hitchhiker`

PrintMotd yes

#PrintLastLog yes

TCPKeepAlive yes

#UseLogin no

#UsePrivilegeSeparation yes

#PermitUserEnvironment no

#Compression delayed

#ClientAliveInterval 0

#ClientAliveCountMax 3

UseDNS no

#PidFile /var/run/sshd.pid

#MaxStartups 10

#PermitTunnel no

# no default banner path

#Banner /some/path

# override default of no subsystems

Subsystem   sftp   /usr/lib64/misc/sftp-server

AllowUsers MyUser

# Example of overriding settings on a per-user basis

#Match User anoncvs

#   X11Forwarding no

#   AllowTcpForwarding no

#   ForceCommand cvs server
```

Thanks you about your fast repaly  :Smile: 

----------

## MostAwesomeDude

Your /etc/ssh/ssh_config appears to be a copy of your /etc/ssh/sshd_config, which is not a Good Thing. Here, you can have mine:

```
ForwardX11 yes

Protocol 2
```

Seriously, a blank /etc/ssh/ssh_config would work fine. "Protocol 2" is not a bad idea, but you probably don't need it with modern servers.

----------

## KingYes

So.. what i am need change for its will run ok ?

----------

## fabien29200

There are 2 configuration files for ssh :

/etc/ssh/ssh_config which is the configuration for the client SSH

/etc/ssh/sshd_config which the configuration for the server SSH

And in the trace of ssh, we can see it is complaining about wrong options. These options are only for the server.

So did you copy your server configuration onto the client configuration ?

You just have to edit  /etc/ssh/ssh_config.

Delete all the lines and paste the 2 lines MostAwesomeDude paste on his post. This should work after that.

----------

## KingYes

fabien29200 and MostAwesomeDude.. Big Thanks !! Now all work ok.  :Smile: 

----------

