LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-03-2006, 12:32 PM   #1
Kharl
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Rep: Reputation: 0
Unhappy A newbie's question about SSH ... ( Fedora Core 4 )


Following all the posts about SSH I could find, this is what I've set up. I'm trying to connect locally through PuTTY from my windows machine to my linux box.

Modem
....|
Router
....|---------------------|
192.168.1.101.......192.168.1.100
..( Linux )...............( Windows )

- I have forwarded port 22 ( TCP ) to 192.168.1.101
- I have changed the listen address in the sshd_config to 192.168.1.101, and made sure the port is 22.
- I have shutdown iptables
- Of course, I have made sure the SSHD is running.

If it would help, this is my current sshd_config ...

Code:
#	$OpenBSD: sshd_config,v 1.72 2005/07/25 11:59:40 markus 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 192.168.1.101
#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 yes
#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 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 no

#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

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem	sftp	/usr/libexec/sftp-server
Now, I *think* the problem is the ListenAddress (by default it was 0.0.0.0), however, when I take the comment out, and I restart the daemon, it gives me a sshd dead but subsys locked error. From what I've reseached, one of the causes of this is an error in the config file, and it only happens when I edit this line. I can get rid of the subsys error now, but I still do not know how to edit the listen address, as this seems to be what is needed.


(( Thanks in advance for any help! ))
 
Old 04-03-2006, 12:40 PM   #2
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
this may sound dumb on my part, but if that's your sshd_conf verbatim, then you haven't 'uncommented' the lines, you've simply edited the listen address to reflect the 192.......

you have to remove the '#'s' to uncomment.

cheers,
 
Old 04-03-2006, 12:53 PM   #3
bxbd
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
help

first thing that struck me was that most of the lines in your config file are still commented out, notably the "ListenAddress" line. if a line starts with # it's not going to be read by the application, it's commented. this is a feature BUT ListenAddress defaults to 0.0.0.0 meaning "listen on all addresses" which sounds fine so why mess with it?

i'd suggest that you also uncomment the "AllowRootLogin" line and change the value to "No"

for real security, it's commonly suggested (though i find a PITA) to set PasswordAuthentication to No - and this means that you can only login using ssh keys, highly secure, but if your eyes are glazing over at this point, probably better to disregard for now

but i think the final answer may be either a) you haven't got your network interface on that machine set up properly (what's ifconfig say?) or b) sshd isn't running (try /etc/init.d/sshd status)

another possibility to your real problem, which i actually ran into the other day (frustrated the hell out of me), is that your router is not properly forwarding packets for clients on the same network. in my case my linksys wrt54g was intercepting all requests to port 80 from any machine connected to it to any machine connnected to it, in other words my desk machine could not request webpages from my server connected to the same router, unless i requested by ip address (making using virtual hosts impossible) - linksys tech support confirmed that this is "expected behavior" for (i think) v. 1.67 of the firmware.
ANYWAY, you might have something similar going on, try telnetting to port 22 of the machine you're trying to login to and see if it seems like a normal ssh server or not, then try to ssh into a machine OFF your network (hope you've got one) and from there ssh BACK IN to the server you really want to connect to - this will bypass the above problem, as the router sees the ssh request coming from an external network and should forward the packets (more) correctly.

*update* oh and why not run man sshd_config ... or hit it here: http://www.hmug.org/man/5/sshd_config.php

Last edited by bxbd; 04-03-2006 at 12:54 PM.
 
  


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
Newbie's ssh and router question Normanya Linux - Networking 8 07-31-2005 10:18 PM
SSH works on Windows but Fedora Core 3? LLinuXX Linux - Newbie 4 02-02-2005 12:19 PM
Fedora Core 1 SSH Pause Mike-BB Linux - Software 2 12-15-2004 05:56 PM
SSH tunneling in Fedora Core 2 ravalox Linux - Networking 1 07-14-2004 04:20 PM
SSH from outside LAN - Fedora Core 2 Robstro Linux - Networking 1 06-24-2004 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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