Improve Linux security

ANALYSIS
One of the attractions of Linux is its native support for a wide range of TCP/IP services, many of which are configured to run by default. Those default services, however, can expose your Linux networked workstation to external intruders. If your workstation is connected to a TCP/IP network with active network services, you're exposing your system to all other clients on the network. If the telnet server application is active, a telnet client running on another workstation on the network can easily establish a login session on your system; it needs only the address of your system and the port or socket number of a network service running on your system. And like other commonly used TCP/IP applications, telnet has a standard defined port number, 23, which is also the address of the running telnet server application. So any telnet client running on any remote workstation on the network can establish a login session to your workstation over port 23. To reduce your workstation's vulnerability to such an attack, users should first find out what networked services are running, determine which ones can be retained with minimum security risk, and stop the rest of those services. There are three places to look for active network services on your workstation: the /etc/inetd.conf file, the /etc/xinetd.conf file, and the /etc/rc.d directories. Services run by the inetd daemon
The Linux inetd daemon is a network service utility that provides a central point of control for all Internet services running on a system. The inetd daemon listens for network ports listed in the /etc/inetd.conf file. Each line of the inetd.conf file lists one service that inetd is to listen for. When an incoming request matches a network port number specified in the file, inetd assigns the appropriate application to the incoming socket. For example, if an incoming request asks for port 21 and ftp is listed in the /etc/inetd.conf file, inetd will then connect the client to the ftp service, after which it resumes listening in on the other ports listed in its configuration file. To find out if the inetd daemon is running on a workstation, open a terminal window and enter the following command:ps aux | grep inetd
Figure A
The results of this command, shown in Figure A, indicate if the service is running and when it was started. Once you know the inetd daemon is running, you should enter the following command to see which network services inetd is listening for:grep -v "^#" /etc/inetd.conf
The results of this command are also shown in Figure A. There, you can clearly see that inetd is listening for ftp, finger, and ntalk, among others. Figure A shows the /etc/inetd.conf file as configured by the installation script that came with the Red Hat 6.1 CD. However, the file needs considerable modification to secure the system. This can be done by editing the file through a text editor, such as vi, and removing unnecessary services. For example, lines specifying older utilities, such as talk and ntalk, which allow interactive communications between you and another user on the network, should be deleted. Another older utility, finger, which runs by default over port 79 and allows a remote client to find out user information, should also be deleted. These services do not have security features required for today's networks. Shell  and login are RPC-based daemons that should be replaced with their more secure versions (i.e., SSH and slogin, respectively). The ftp and telnet services should also be replaced by their more secure counterparts, scp or http for ftp, and sshd for telnet. (Note that large installations should not be running http on every desktop. Instead, workstations in these installations should be accessing the Web via a separate Web server.) Another problem is that root is entered in the user field of many services. It is recommended that services never be run as root unless absolutely necessary, and then only if they are strictly monitored. If they are not, the user field of each line should be replaced with nobody, which is preferred. Services run by the xinetd daemon
If you find that inetd is not present on your workstation, it doesn't mean that you have no active network services. Later versions of Linux, such as Red Hat 7.0 and above, have replaced the inetd daemon with the extended Internet services daemon, xinetd. Like inetd, xinetd listens for connection requests from client applications. When it receives a connection request to a port, xinetd starts up the TCP/IP service for that port, handing over the port to the network service so the client can work with the service. To see if xinetd is running on your system, open a terminal window and enter the same ps command listed above, replacing inetd with xinetd:ps aux | grep xinetd
Figure B
The results of this command, shown in Figure B, indicate if the xinetd service is running and when it was started. Just like inetd, xinetd also works with a configuration file, /etc/xinetd.conf. This file can be found by entering the following command: grep -v "^#" /etc/xinetd.conf

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

apexwm

NanWag : A Windows Server 2008 is being used because the environment that the Macs are in is a heavy Windows environment. I am proposing that...

37 minutes ago by apexwm on Windows Server 2008 drops the ball for Mac compatibility
BellamysIT

Really good article. You bring to light a few really good things. However, isn't it true that over 70% of fortune 500 companies use sharepoint?...

38 minutes ago by BellamysIT on Designing a SharePoint farm: Tiers before bedtime
annonymous2

If Piratebay is a crime then so is borrowing a dvd you purchased to a family member or a friend. Why should we not be aloud to share. Most of the...

2 hours ago by annonymous2 on UK ISPs ordered to block Pirate Bay website
NanWag

File Services For Macintosh was causing Excel to prompt for Overwriting changes or Save Another Copy because it was changing the timestamp on the...

3 hours ago by NanWag on Windows Server 2008 drops the ball for Mac compatibility
Regis Machado

creative cloud $48/month in the USA, £48/month in the UK ($79). good for the competitors

5 hours ago by Regis Machado via Facebook on Adobe move promotes piracy
Tom Espiner

Hello KosGirl, Good question. I've asked Belfius for a response. The latest post I can find on Pastebin about it is here:...

5 hours ago by Tom Espiner on Hackers hold bank to ransom over stolen data
KosGirl

Have there been any further updates to this story? I can't find any information on whether the hackers released the data or not.

6 hours ago by KosGirl on Hackers hold bank to ransom over stolen data
SandJ

I have done 7 speed tests this morning on different speed test tools. They tell me my download speed is: 12.3, 12.3, 12.3, 11.1, 12.7, 12.7, 11.7...

7 hours ago by SandJ on Watchdog: TalkTalk's broadband speed test misled users
Jack Schofield

@Mary Microsoft could always send Mozilla a spec sheet and oblige them to meet the same standards as IE. Then Mozilla can spend millions of...

10 hours ago by Jack Schofield on Windows RT browsers and the point of Windows RT
goth1csnake3

Not before time, that people making films,dvd's get whats coming to them. Well done, Virgin Media.

12 hours ago by goth1csnake3 on Virgin Media: Spotify deal will bring down piracy
Simon Bisson and Mary Branscombe

Apex - the question then is what about letting the user choose to have a tablet where they don't have to have that responsibility? why can't the...

22 hours ago by Simon Bisson and Mary Branscombe on Windows RT browsers and the point of Windows RT
Simon Bisson and Mary Branscombe

Moley, Apex, thanks; I think there's an interesting other dimension of choice - the choice to have a platform that is 'locked down' in the sense...

22 hours ago by Simon Bisson and Mary Branscombe on Mozilla accuses Microsoft of shutting Firefox out of WOA
Yellowcave

Not surprised. I once used the methods to let my firewall just notify me of breaches. Not one single logged event was genuine. Once, we all...

1 day ago by Yellowcave on Mobile porn filters catch innocent content, says report
duplex

live realy sucks in facebook becuase people hack your profile

1 day ago by duplex on Irish watchdog: Facebook privacy still falls short
Ed Macnair

If only it was that simple. When you start accessing Cloud applications you are stuck with the security model the vendor provides...........unless...

1 day ago by Ed Macnair via Facebook on IT security? You're doing it wrong!
Phil at Cloud4

Another good updaet, I have enjoyed going on the journey reading this series on SharePoint 2010 and have learned alot. Great writing.

1 day ago by Phil at Cloud4 on Designing a SharePoint farm: Tiers before bedtime
muteen

roumers of an ipad Mini, isnt that just an iTouch!?

1 day ago by muteen on Apple rebrands iPad 4G as 'Wi-Fi + Cellular' for UK
apexwm

Thanks for this article and bringing this issue to light. Unfortunately this type of activity is common not only with Adobe, but many other...

1 day ago by apexwm on Adobe move promotes piracy
Andy Bolstridge

there's a very thin line between tax avoidance and tax efficiency - earning £850 a month and claiming dividends to bring my income up to normal...

1 day ago by Andy Bolstridge via Facebook on The Idle Self-employed
Andy Bolstridge

I see that they are happy to announce these numbers.. but no-one will take any notice until they start announcing sales numbers too.

1 day ago by Andy Bolstridge via Facebook on Microsoft's score card for Smoked by Windows Phone