LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-14-2002, 05:03 AM   #1
c_lhee
LQ Newbie
 
Registered: Oct 2002
Location: Asia
Distribution: Redhat 6.2
Posts: 4

Rep: Reputation: 0
Question two ssh versions.


Hi,

I have upgraded the ssh version in my Linux,
the latest is SSH 3.1.0 (non-commercial version) on i686-pc-linux-gnu.

Problem is I am looking at two configurations at
/etc/ssh_config
/etc/sshd_config

and another at
/etc/ssh2/ssh2_config
/etc/ssh2/sshd2_config

Why does the ssh config get the settings on "/etc" instead of "/etc/ssh2"? Where can I define this?

The server is secure from windows users using ssh.
However it allows users from linux servers to access
even though only a specific ip is allowed to access.
 
Old 10-14-2002, 05:22 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Guess you need to upgrade first.
Lastest still is openssh-3.4p1.tar.gz.
Configs should be in /etc/ssh unless you mucked with the source.
If compiled with libwrap (TCP Wrappers) add a line (w/o quotes) to /etc/hosts.allow
"ssh: <ip address allowed access from>"
You can tighten access more by adding the Deny(Users|Groups), Allow(Users|Groups) directives to /etc/ssh/sshd_config, and block in the firewall as well.
 
Old 10-15-2002, 04:20 AM   #3
c_lhee
LQ Newbie
 
Registered: Oct 2002
Location: Asia
Distribution: Redhat 6.2
Posts: 4

Original Poster
Rep: Reputation: 0
openssh has lots of vulnerabilities. any other versions
besides openssh ? have you tried using ssh only?

Here are my sshd_config settings____________
# This is ssh server systemwide configuration file.

Port 22
ListenAddress 0.0.0.0
HostKey /etc/ssh_host_key
RandomSeed /etc/ssh_random_seed
ServerKeyBits 768
LoginGraceTime 600
KeyRegenerationInterval 3600
PermitRootLogin yes
IgnoreRhosts no
StrictModes yes
QuietMode no
X11Forwarding yes
X11DisplayOffset 10
FascistLogging no
PrintMotd yes
KeepAlive yes
SyslogFacility DAEMON

RhostsAuthentication yes
RhostsRSAAuthentication yes
# HostbasedAuthentication no
# AllowedAuthentications hostbased

RSAAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords no
UseLogin yes
# CheckMail no
# PidFile /u/zappa/.ssh/pid
# AllowHosts newbie.com
AllowHosts
# DenyHosts *
# Umask 022
# SilentDeny yes
__________________________________
How do I uninstall the ssh that was installed
so
I can install a different version of ssh.
 
Old 10-15-2002, 10:36 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Why does the ssh config get the settings on "/etc" instead of "/etc/ssh2"? Where can I define this?
sshd -f <configfile>, also defined in your startup script /etc/rc.d/init.d/ssh(d?)

Quote:
any other versions besides openssh?
Only one or two commercial versions AFAIK.

Quote:
have you tried using ssh only?
What do you mean by this?

Quote:
How do I uninstall the ssh that was installed so
I can install a different version of ssh.
IIRC correct versions are needed for (glibc), libwrap, OpenSSL before upgrading OpenSSH, check with your RPM tools.
If al goes well you can download and make the OpenSSH tarball with which you can make and rpm to install.

Your sshd_config settings:
PermitRootLogin yes: insecure, set to "no"
IgnoreRhosts no: insecure, set to "yes"
RhostsAuthentication yes: insecure (sshv1), set to "no"
RhostsRSAAuthentication yes: insecure (sshv1), set to "no"
UseLogin yes[b]: disables Xforwarding[b]
AllowHosts: won't work in sshv2: if compiled with libwrap use /etc/hosts.{deny,allow}

HTH.
 
Old 10-17-2002, 11:07 PM   #5
c_lhee
LQ Newbie
 
Registered: Oct 2002
Location: Asia
Distribution: Redhat 6.2
Posts: 4

Original Poster
Rep: Reputation: 0
I have defined this in
file "/etc/rc.d/rc.local"
and included script "/usr/local/sbin/sshd &"
so ssh can run during startup.

You are right on "AllowHosts", however /etc/hosts.{deny,allow}
dont work either, why is that is there anything i should do..

fyi done this already "ssh: <ip address allowed access from>"
 
Old 10-18-2002, 07:15 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Btw, Red Hat's 6x releases haven't been the best in terms of security. Did you regularly check for upgrades?

/etc/hosts.{allow,deny} should take lines like
<service name|ALL>: <IP addr/range|ALL (EXCEPT FROM addr/range)>
If it doesn't work, probably your sshd hasn't been compiled with TCP Wrappers support (-llibwrap iirc).

Sshd should run from a script in /etc/rc.d/init.d linked to your runlevel else you make managing checking/starting/stopping services hard on yourself. It should be in the rpm or the contrib dir of the tarball. If not it's quite easy to write one taking one of the scripts in /etc/rc.d/init.d as a template. If the script you wrote won't work, check for application locations, if the application config is readable/correct, if you provided all startup variables like config, if running the script command manually logs any errors, if running the script command manually with debug enabled logs any errors.
 
Old 10-22-2002, 05:07 AM   #7
c_lhee
LQ Newbie
 
Registered: Oct 2002
Location: Asia
Distribution: Redhat 6.2
Posts: 4

Original Poster
Rep: Reputation: 0
Have compiled the ssh to use "tcp wrapper", e.g. "--with-libwrap".
However after setting this on "hosts.allow" and "hosts.deny" it does not work. Should the settings be also included in the "inetd.conf"?

Fyi in the "sshd2_config" the setting "AllowHosts" works when configured.

I want to ensure that even connecting will return a message
"Connection Failed" for ip's that are not allowed to connect.

Thanks.
 
Old 10-22-2002, 09:03 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Have compiled the ssh to use "tcp wrapper", e.g. "--with-libwrap". However after setting this on "hosts.allow" and "hosts.deny" it does not work. Should the settings be also included in the "inetd.conf"? Doh. I you run sshd through xinetd it'll have it's own way of denying access like using TCP Wrappers. Dunno bout inetd tho. It's old, less secure, deprecated. Adding a new version of ssh to your box may seem like false security, because the system supporting it stems from the time dinos walked the earth. Guess you never upgraded anything on that box?

Fyi in the "sshd2_config" the setting "AllowHosts" works when configured. Guess you have to remove your old ssh binaries and configs and decide what conf to use.

I want to ensure that even connecting will return a message "Connection Failed" for ip's that are not allowed to connect.If you only have a few addresses that are allowed access to ssh block others tru the firewall. If you did configure sshd to use TCP Wrappers and run in standalone mode it could use TCP Wrappers' banner function to present a msg of choice.
 
  


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
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
[SSH] Issue logging in [SSH & Permissions] MD3 Linux - Networking 11 12-10-2006 09:25 AM
Mac OS X ssh client / linux sshd : ssh hangs/disconnects Apollo77 Linux - Networking 1 05-24-2006 11:53 AM
I turned off SSH, but I cant get it back! How do you start SSH on boot? nmoog Slackware 2 02-08-2004 05:18 PM
ssh issue: /usr/bin/ssh -x -oFallBackToRsh no -l WeNdeL Linux - Software 1 03-04-2003 07:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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