You are not logged in.

#1 2007-12-10 04:07:40

osc~
Member
From: brazil
Registered: 2007-07-06
Posts: 117
Website

[Solved]ssh doesnt work

when i try to connect to my laptop from another computer i get.

ssh: connect to host 192.168.0.178 port 22: Connection refused
lost connection

i already edited the /etc/hosts.allow:

#
# /etc/hosts.allow
#
sshd ALL:ALL

# End of file

i still get the same error.

what could be the problem?
what else can i do?

Last edited by osc~ (2007-12-11 02:57:45)

Offline

#2 2007-12-10 04:49:17

sacamano_m82
Member
Registered: 2007-05-29
Posts: 167

Re: [Solved]ssh doesnt work

I think the line should be : sshd: ALL

Offline

#3 2007-12-10 10:09:38

High|ander
Member
From: Skövde, Sweden
Registered: 2005-10-28
Posts: 188
Website

Re: [Solved]ssh doesnt work

or
sshd: ALL : ALLOW


When death smiles at you, all you can do is smile back!
Blog

Offline

#4 2007-12-10 13:54:00

VikM
Member
Registered: 2007-11-10
Posts: 50

Re: [Solved]ssh doesnt work

"Connection refused" means that there is nothing listening on that port (22) or the port is blocked with iptables REJECT.

- check that sshd is really running
- any firewall?

Last edited by VikM (2007-12-10 13:54:14)

Offline

#5 2007-12-10 14:22:02

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: [Solved]ssh doesnt work

did you change the port number in the config? if so, make sure you're adding it to the command. also check to make sure the daemon is in fact running.

Offline

#6 2007-12-10 14:31:16

osc~
Member
From: brazil
Registered: 2007-07-06
Posts: 117
Website

Re: [Solved]ssh doesnt work

i changed the hosts.allow to

sshd: ALL : ALLOW

i also added sshd in the /etc/rc.conf DAEMONS.

slackhack wrote:

did you change the port number in the config? if so, make sure you're adding it to the command. also check to make sure the daemon is in fact running.

i didnt change any port number.

my /etc/ssh/sshd_config is:

#    $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 ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
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:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6

#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 yes
#PermitEmptyPasswords no

# Change to no to disable 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

#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem    sftp    /usr/lib/ssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#    X11Forwarding no
#    AllowTcpForwarding no
#    ForceCommand cvs server

i also typed:

 /etc/rc.d/sshd start
:: Starting Secure Shell Daemon                                          [FAIL]

thanks
cheers

Last edited by osc~ (2007-12-10 14:38:38)

Offline

#7 2007-12-10 15:22:42

VikM
Member
Registered: 2007-11-10
Posts: 50

Re: [Solved]ssh doesnt work

Sshd is not running. Does /var/log/everything/log contain anything about ssh?
What happens if you manually run

/usr/sbin/sshd

Not very elegant, but also try

pacman -S openssh
:: openssh-4.7p1-6: local version is up to date. Upgrade anyway? [Y/n] Y
resolving dependencies... done.
looking for inter-conflicts...

Offline

#8 2007-12-10 16:38:48

osc~
Member
From: brazil
Registered: 2007-07-06
Posts: 117
Website

Re: [Solved]ssh doesnt work

when i run /usr/sbin/sshd nothing happens.

in /var/log/everything.log there is nothing about ssh

Offline

#9 2007-12-10 18:51:42

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: [Solved]ssh doesnt work

osc~ wrote:

when i run /usr/sbin/sshd nothing happens.

You mean you don't get any message on console? Or you mean that sshd process is not created? (Check with 'ps x | grep sshd').

Offline

#10 2007-12-10 19:21:56

osc~
Member
From: brazil
Registered: 2007-07-06
Posts: 117
Website

Re: [Solved]ssh doesnt work

sorry, yeah i dont get any message.


ps x | grep sshd
 7660 ?        Ss     0:00 /usr/sbin/sshd
 9847 pts/0    S+     0:00 grep sshd

Offline

#11 2007-12-10 23:01:21

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: [Solved]ssh doesnt work

Well, so since sshd is running (manually), I'd try again to connect to it ("ssh localhost") to see if it accepts connections OK. If it does, but not from outside, then you've got a problem not with sshd, but with some firewall/filter along the way. If it doesn't, then you have a problem with sshd_config; but by the looks of yours it seems OK.

Offline

#12 2007-12-10 23:20:08

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: [Solved]ssh doesnt work

+1

looks like it's your firewall.

Offline

#13 2007-12-11 02:57:25

osc~
Member
From: brazil
Registered: 2007-07-06
Posts: 117
Website

Re: [Solved]ssh doesnt work

i dont know how or what i did (i think a combination of everything) but it ended up working.
thanks alot
smile

Offline

Board footer

Powered by FluxBB