LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2007, 06:51 PM   #1
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Rep: Reputation: 15
SSH via LAN


I have some problems with SSH.

Here's what I did.

iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT

I get the network connection refused error when I try to connect via LAN.

I don't know what's wrong?

How do you even start ssh?

Maybe it's because it's not started.
 
Old 01-25-2007, 07:14 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
It would make life easier all around if you indicated what distribution you have. For SuSE, you could install ssh and enable it in YaST. On SuSE and others you could instead run "/sbin/chkconfig --list sshd" to check if the service is running:
Code:
sshd                      0:off  1:off  2:off  3:on   4:off  5:on   6:off
If you have the /sbin/chkconfig command, you can use it to check if sshd is enabled, or enable it for certain run levels.
Code:
sudo /sbin/chkconfig -s sshd 35
However some distro's use a different model for starting services, and some use different run level numbers.

Before doing that, it would be a good idea to secure the service. Look in "man sshd_config" for information on all the options. I would recommend disallowing root logins. Also, if only one user is authorize to login, then I would recommend using "AllowUsers <username>", or if a handful of users can log in, create a group and add the users to that group. Then use "AllowGroup <sshgroupname>".

It would also be a good idea to only support ssh version 2. Many people also change the port number to reduce the number of script kiddie brute force attacks.

Last edited by jschiwal; 01-25-2007 at 07:15 PM.
 
Old 01-25-2007, 07:22 PM   #3
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
Sorry about that. I'm running debian etch. Command line only.
 
Old 01-25-2007, 07:58 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
I don't have debian. Read the comments in the /etc/inittab file to see what runlevels are used. Using google I found the invoke-rc.d command. For example: "invoke-rc.d ssh start" or "invoke-rc.d sshd start" might work.

You probably want to locate an administrator's guide on your system or a debian wiki on the web to become more familiar how debian systems work.

Last edited by jschiwal; 01-25-2007 at 08:55 PM.
 
Old 01-25-2007, 08:09 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Does

chkconfig sshd on

work in debian?

If so, then try

service sshd start
 
Old 01-25-2007, 08:42 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Quote:
Does chkconfig sshd on work in debian?
No, that is a Fedora/Suse/Windows shortcut. In debian, the command would be
Code:
/etc/init.d/sshd start
Also, to see if it is already running, try
Code:
ps aux|grep sshd
Peace,
JimBass
 
  


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
SSH outside LAN Siiiiiii Linux - Networking 6 01-05-2007 07:55 AM
SSH in LAN works, but not from outside max2004 Linux - Networking 4 07-22-2006 12:27 PM
ssh from outside my lan? danimal87 Linux - Newbie 4 09-04-2005 11:35 AM
problems about ssh and LAN franz77 Linux - Networking 3 01-09-2005 04:41 AM
SSH access from outside the LAN? jdp Linux - Newbie 1 05-02-2004 02:12 PM


All times are GMT -5. The time now is 06:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration