LinuxQuestions.org
Visit Jeremy's Blog.
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 03-27-2004, 01:07 PM   #1
datus
LQ Newbie
 
Registered: Mar 2004
Distribution: RedHat Linux9 & FreeBSD4.9
Posts: 2

Rep: Reputation: 0
Question SSH how to configure differently for different cards (ie root access)


I am using ssh to connect to a "firewall" machine and was wondering if it was possible to allow ssh root access on the internal nic only and not on the exernal nic. (how?)
 
Old 03-27-2004, 04:59 PM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Absolutely. You need to start multiple SSH daemons with different config files. By default your system will start one SSH daemon from it's startup scripts, and that will use /etc/ssh/sshd_config as it's config file.

What I would do is copy your existing RC script for sshd, call it sshd_int or something like that. You'll need to create links to it from all the init levels you want it to run at in /etc/rc.d/*. Then edit the sshd_int script and make sure when /usr/sbin/sshd is started, you use -f <yourconfigfile>. Such as /usr/sbin/sshd -f /etc/ssh/sshd_config_int

Now of course you need to copy /etc/ssh/sshd_config to /etc/ssh/sshd_config_int as well, so you can edit that file. Here is what you need to change:
ListenAddress (needs to be your internal IP)
PermitRootLogin (although I would strongly suggest that you DO NOT DO THIS, use a normal user and use sudo to run command as root--don't login as root!)

You should also change ListenAddress in your original sshd_config to be just your external address. If your external address is obtained by DHCP, then there are a few other things you have to do to make sure the two daemons don't conflict with each other.

$ man sshd
$ man sshd_config

for more information. I got all of the above from the man pages.
 
Old 03-27-2004, 05:31 PM   #3
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
You could disallow root access all together, internal and external, and then use su to change to root when you need.
 
Old 03-28-2004, 02:48 PM   #4
datus
LQ Newbie
 
Registered: Mar 2004
Distribution: RedHat Linux9 & FreeBSD4.9
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks

Thanks alot guys. I really appreciate the help
 
  


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
How to add user with root privileges and SSH access adamrad Linux - General 8 10-31-2006 02:53 PM
SSH Root Access DediPlace Linux - Security 6 05-29-2005 11:05 AM
Prevent Root access with SSH rshooper Linux - Security 4 11-18-2004 01:05 PM
ssh access allowed only to root user? zovres Linux - Newbie 5 09-25-2003 04:19 PM
Anyway to use rsync ssh without allowing root access? ifm Linux - Security 0 06-12-2002 01:01 PM

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

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