LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-31-2005, 02:31 PM   #1
jeucken
Member
 
Registered: May 2002
Location: Alphen aan den Rijn, The Netherlands
Distribution: SuSE 10.1
Posts: 87

Rep: Reputation: 15
Question SSH users


Well it's almost new year and guess who has to re-install his SuSE server because of some security issues.

Although the good side is that I'm going from SuSE 8.1 to SuSE 10.0.

Anyway, I'm having a problem with my SSH.
It is running and I can connect to it.

But when I try to login using a username that exists on the SuSE machine it gives an 'access denied'.

How can I give that user the rights to login to SSH?

(Makes the configuration of the thing a whole lot easier because the chair @ the desktop computer is much more comforting )
 
Old 12-31-2005, 02:48 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Can you post the output of the following please (hostname is the ssh server you are connecting to)?
Code:
ssh -v hostname
 
Old 01-01-2006, 07:56 AM   #3
jeucken
Member
 
Registered: May 2002
Location: Alphen aan den Rijn, The Netherlands
Distribution: SuSE 10.1
Posts: 87

Original Poster
Rep: Reputation: 15
Hmmm, how can I do that from Putty?
(please note: the computer I'm using to connect to the SuSE server is Win XP)

But I tried it also @ SuSE and when I tried to SSH to localhost it all went a-ok.

So apparently it just won't accept SSH logins from the outside.
 
Old 01-01-2006, 02:10 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Sorry, I did mean to run the `ssh -v` from your Linux box. From putty, you can turn on logging from Session / Logging / Log SSH packet data.

Have you tried to telnet to the SSH port on the Linux box from the Windows box? If the Suse box were at 192.168.1.5:

telnet 192.168.1.5 22

should display the SSH banner on the Linux box - I get `SSH-2.0-OpenSSH_4.2`.

If you can't connect then it may be the Windows firewall, the Suse firewall, or the Suse SSH configuration.

If it's firewall (packet) related...

If you have ethereal running on both boxes, you can check whether the SSH traffic leaving the Windows box arrives at the Suse box, or whether the return traffic leaving the Suse box is getting back to the Windows box. Just restrict ethereal with a `port 22` filter to cut down the data it collects.

If it's config related...

Are you running your SSH daemon standalone or out of inetd? You can check for ssh in /etc/inetd.conf. If so, look for entries in /etc/hosts.allow or /etc/hosts.deny that restrict remote access to ssh or ALL.

Do you have any settings in /etc/ssh_config that aren't global (look for a line beginning with `host`)? Do you have any settings in /etc/sshd_config that limit where the daemon will accept connections (look for lines beginning with ListenAddress)?

Sorry it's not more specific help
 
Old 01-02-2006, 11:36 AM   #5
jeucken
Member
 
Registered: May 2002
Location: Alphen aan den Rijn, The Netherlands
Distribution: SuSE 10.1
Posts: 87

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead
Have you tried to telnet to the SSH port on the Linux box from the Windows box? If the Suse box were at 192.168.1.5:

telnet 192.168.1.5 22

should display the SSH banner on the Linux box - I get `SSH-2.0-OpenSSH_4.2`.
I get: 'SSH-1.99-OpenSSH_4.1'
Quote:
Are you running your SSH daemon standalone or out of inetd? You can check for ssh in /etc/inetd.conf.
It is started from /etc/init.d/rc3.d and /from/etc/init.d/rc5.d.
(SuSE 10.0 doesn't use inetd.conf, it uses xinetd.conf)
Quote:
If so, look for entries in /etc/hosts.allow or /etc/hosts.deny that restrict remote access to ssh or ALL.
hosts.allow is empty
hosts.deny says: http-rman: ALL EXCEPT LOCAL
Quote:
Do you have any settings in /etc/ssh_config that aren't global (look for a line beginning with `host`)?
It only has a couple of commented out hostkey lines.
Quote:
Do you have any settings in /etc/sshd_config that limit where the daemon will accept connections (look for lines beginning with ListenAddress)?
It has:
listenaddress 0.0.0.0
listenaddress ::

But these are also commented out.

Keep in mind that I can connect to the server using Putty. But if I insert my login name and the correct password it just gives an access denied.
 
Old 01-02-2006, 12:17 PM   #6
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
jeucken:
It's not a firewall, because you can see the ssh banner when you telnet.
I don't think it's /etc/hosts.allow or hosts.deny, because you get a login prompt.
It's a simple case of your ssh server not allowing the username you're using to connect to it.
Make sure the following is in your /etc/sshd_config file:
Code:
AllowUsers user1 user2 user3
This lists the users which are allowd to connect via ssh.

Also make sure you DO NOT have the following line in your sshd_config file:
Code:
DenyUsers *
as this would deny all users (* is the wildcard).

If you have a "DenyUsers" entry, delete it or adjust it accordingly.

Let us know the results.
 
Old 01-02-2006, 02:22 PM   #7
jeucken
Member
 
Registered: May 2002
Location: Alphen aan den Rijn, The Netherlands
Distribution: SuSE 10.1
Posts: 87

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by WindowBreaker
Make sure the following is in your /etc/sshd_config file:
Code:
AllowUsers user1 user2 user3
This lists the users which are allowd to connect via ssh.
I didn't have AllowUsers in my sshd_config. But when I added it, I still got access denied.
Quote:
Also make sure you DO NOT have the following line in your sshd_config file:
Code:
DenyUsers *
as this would deny all users (* is the wildcard).

If you have a "DenyUsers" entry, delete it or adjust it accordingly.
DenyUsers isn't in my sshd_config.

My sshd_config:
Code:
#	$OpenBSD: sshd_config,v 1.70 2004/12/23 23:11:00 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
#Protocol 2,1
#AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress ::

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

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable support for the deprecated 'gssapi' authentication
# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included
# in this release. The use of 'gssapi' is deprecated due to the presence of 
# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to.
#GSSAPIEnableMITMAttack no
 

# 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 mechanism. 
# Depending on your PAM configuration, this may bypass the setting of 
# PasswordAuthentication, PermitEmptyPasswords, and 
# "PermitRootLogin without-password". If you just want the PAM account and 
# session checks to run without PAM authentication, then enable this but set 
# ChallengeResponseAuthentication=no
UsePAM yes

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

# no default banner path
#Banner /some/path

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

# This enables accepting locale enviroment variables LC_* LANG, see sshd_config(5).
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
AcceptEnv LC_IDENTIFICATION LC_ALL
Please note: Permitrootlogin is enabled at this time. But when SSHD is correctly running I will disable it.
 
Old 01-02-2006, 03:29 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Can I suggest that you change the following lines?

From:
Code:
#Protocol 2,1
To:
Code:
Protocol 2
From:
Code:
PasswordAuthentication no
To:
Code:
PasswordAuthentication yes
From (change this only if the above does not work):
Code:
UsePAM yes
To:
Code:
UsePAM no
Apart from X11Forwarding and the locale environment variables at the bottom of the file, those are the only security related differences to my sshd_config.
 
Old 01-03-2006, 10:48 AM   #9
jeucken
Member
 
Registered: May 2002
Location: Alphen aan den Rijn, The Netherlands
Distribution: SuSE 10.1
Posts: 87

Original Poster
Rep: Reputation: 15
Cool

Quote:
Originally Posted by gilead
Can I suggest that you change the following lines?

From:
Code:
#Protocol 2,1
To:
Code:
Protocol 2
From:
Code:
PasswordAuthentication no
To:
Code:
PasswordAuthentication yes
That did the trick!
Thanks

Up to the next problem
 
Old 01-03-2006, 12:50 PM   #10
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Glad to hear it
 
Old 05-31-2006, 03:10 PM   #11
cblakework
LQ Newbie
 
Registered: May 2006
Location: Billerica, MA
Distribution: Suse v10, Red Hat Enterprise
Posts: 1

Rep: Reputation: 0
I ran into this as well doing a scratch install of SUSE 10. The above solution worked perfectly!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Remove SSH users? o3h Linux - Software 2 12-01-2005 08:25 PM
ssh users mrbabis Linux - Software 6 11-25-2005 10:55 AM
how can i add users to ssh omashhour Linux - Networking 6 12-17-2004 02:59 PM
SSH users kl0wn Linux - Software 2 11-18-2004 03:54 AM
Ssh Users Look At This! DavidPhillips Linux - Security 11 09-16-2002 02:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:26 AM.

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