Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] ssh problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
m4tu-
n00b
n00b


Joined: 02 May 2006
Posts: 19
Location: Finland, nummela

PostPosted: Thu May 04, 2006 7:09 am    Post subject: [SOLVED] ssh problem Reply with quote

hi!

i run to this kinda strange problem on my newly installed gentoo machine (my main machine).
it has ssh daemon running and i can easily ssh from it to other computers in my house (but ofcourse to other peoples computers). The odd thing is that i can't ssh from any machine to my main machine.

i had slack running before and it worked well, it think the problem lies in some conf file but i don't know which.

-thx for your help!


Last edited by m4tu- on Sat May 06, 2006 3:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
manx801
n00b
n00b


Joined: 28 Apr 2006
Posts: 21

PostPosted: Thu May 04, 2006 7:23 am    Post subject: Reply with quote

Do you have the old sshd_config file from slack? If so, you could compare it to your surrent sshd_config. That file lives in /etc/ssh. You might want to double check that sshd is actally running on the gentoo machine, and that the port is open and not blocked (try nmap from one of the other machines). Are you running a firewall? Also, post you sshd_config here.
Back to top
View user's profile Send private message
m4tu-
n00b
n00b


Joined: 02 May 2006
Posts: 19
Location: Finland, nummela

PostPosted: Thu May 04, 2006 7:55 am    Post subject: Reply with quote

ok, i will check that as soon as i come home.
Back to top
View user's profile Send private message
m4tu-
n00b
n00b


Joined: 02 May 2006
Posts: 19
Location: Finland, nummela

PostPosted: Thu May 04, 2006 2:17 pm    Post subject: Reply with quote

ok, here is my /etc/ssh/ssh_config:
Code:
#       $OpenBSD: ssh_config,v 1.21 2005/12/06 22:38:27 reyk Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

# Host *
#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no

it is exactly like the config file that i have on my server and i have no problem ssh:ing to it.
i have the port 22 open and it directs traffic to my server (cause my main machine is not allways on).

when i try to ssh from my server to my main machine it says:
Code:
ssh 192.168.1.33
ssh: connect to host 192.168.1.33 port 22: Connection refused


then i look if sshd is running and it gives this:
Code:
/usr/sbin/sshd
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

i think this is where the problem lies.
the files ssh_host_rsa_key and ssh_host_dsa_key doesn't seem to exist, how do i get them/generate them/make them ?
Back to top
View user's profile Send private message
Aysen
Apprentice
Apprentice


Joined: 18 May 2005
Posts: 187
Location: Poland

PostPosted: Thu May 04, 2006 7:05 pm    Post subject: Reply with quote

You posted ssh_config, but the server configuration is sshd_config.
As for the keys, use ssh-keygen to generate them. You could also read 'man sshd' and/or 'man sshd_config' to set things right in sshd_config if you have further problems.
Back to top
View user's profile Send private message
m4tu-
n00b
n00b


Joined: 02 May 2006
Posts: 19
Location: Finland, nummela

PostPosted: Thu May 04, 2006 7:27 pm    Post subject: Reply with quote

ok, thx for the help. ill hope it works
Back to top
View user's profile Send private message
manx801
n00b
n00b


Joined: 28 Apr 2006
Posts: 21

PostPosted: Thu May 04, 2006 8:45 pm    Post subject: Reply with quote

Ok, so it seems that sshd was not running. If you use the init script: /etc/init.d/sshd it will call ssh-keygen and setup the keys for you. So, to start sshd, you would do (as root):

Code:

/etc/init.d/sshd start


To make this happen each time you boot the machine:

Code:

rc-update add sshd default


It should not be required to edit sshd_config just to get sshd up and running however you might want to change some of the default options. Also, if the port will be open to the world, you might want to use DenyHosts (http://denyhosts.sourceforge.net/) which is available in portage. This will make it diffucult to use brute force attacks on the sshd server.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum