Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.