Click to See Complete Forum and Search --> : Basics for SUSE Linux


gore
July 30th, 2004, 12:50 AM
This is a very basic guide to help configure and secure a SUSE Linux system. I may be doing more, and make this a multi part tutorial, but for now, how about some feed back?

Planned add ons:

Make a complete SUSE guide for configuring SUSE Linux how you want it

Advanced security configuration

Setting up SUSE as a server


------------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--==--==-=-=--==-=-=-=-=-=--==-=-=-=--------------------



Configuring basic security in SUSE Linux




This should work for 8.1 Professional 8.2 Professional and most of 9.1 Professional.



Some of the modules in YAST2 were moved in SUSE Linux 9.1 Professional, but they still work the same so you should have no problems with it, just finding where they were moved too.







Chapter one: Security updates





The first thing you should when you have finished installing SUSE Linux, is to check for updates. Usually you can do this while you're installing, but just in case you haven't you should do it after you boot up.

By default, you should see a little icon in the lower right hand corner, which will turn Red when you have a security update. Just right click on it and select "Check for updates".

this will search online for updates to any software you may have installed. After that it may turn Red, which means updates are out.

If = Red

Then do update

Else = Check which color it turns.

If = Yellow

Then select a new server to check, as this means that it had a problem connecting.

If = Green

Then everything is OK and there are no new updates.


If you found security updates, then right click on the Red icon, and select "Launch YOU" which will launch Yast Online Update. It will display the information like which server it is using.

If your icon was Yellow, you should open this up anyway, and select a new server to use for updates. Just click on the drop down menu where the servers are listed and click on a new one and try again.

If you're updating though then click on "Next" and it will check for updates and display the ones you need. Not everything here listed is needed, but if you have the software on your computer, then it will automatically select it, so you don't really need to to anything.

Also, there is software listed that SUSE could not legally include on the CD, like drivers for Video and Wireless cards, and Microsoft True Type Fonts.

You can select these for install by clicking on check box next to them.

After you have downloaded them, you'll notice a check box saying "Remove sources". this is so you can remove the sources that it is downloading, which is a good idea because it frees up space, and unless you look over everything, you really won't need them much.


After the packages are downloaded and installed, you can go to the next screen and watch the configuration files get written, and then, you're done.



Note that you need Root to do this. If you're not logged in as Root, whatever you want to do that needs to be done as Root will have a little box pop up asking for the Root password. Just type it in, and for the time being, that particular application is now being ran as Root. It's not like Red Hat where you do something similar and then have Root for a set amount of time, it's only for the application you were launching. You have to type it again for every other application you want to run that Needs Root.






Chapter 2 : YAST2




Now, SUSE defaults with KDE, so for the time being, use KDE. This will work in any Window Manager, and will also work in Run Level three. You'll just use an arrow key instead of the mouse.


Open up the YAST control Center by clicking on the lightning bolt Green orb, and selecting "Administration" and then clicking on "YAST2".

A window pops up asking for the Root password again, and then launches. YAST2 is the main configuration utility in SUSE Linux, so learn to use it.

Click on the module titled "Security and Users".

Click on the "Firewall" Icon to launch the Firewall configuration.

The module pops up, and then you can configure the Firewall.

Now, this part I can't walk you through, as I doubt all of you reading have the exact same set up as I do, but I can help:

Read what's on the screen. You should see "External Interface". If you have a Cable connection, or if you're using a Network connection, or a LAN, then you will be selecting "etho" for this.

For the "Internal Interface" that one is up to you.

the screen has directions on the left, so if you're using DSL or Dial up, read it.

After you have this section done, click on "Next" in the lower right of that window, to go to the next page. Clicking "Next" brings you to a page with a few more options than the last.

If you're NOT running a server in which people need access to your machine, then do NOT click on anything here. This is for punching holes in the firewall to allow access to services on your box.


If you're going to be using SUSE for a server, than go ahead and click on what you need to allow access with.

I'm going to use this box for Apache, FTP, and SSH, so I click on the following:

HTTP

Secure Shell

And then I click on "Expert" and type in "21" for the FTP port.

you may open as many ports as you want here, and I don't think I have to walk you through anymore. I told you how to open up the FTP port, and if you're setting up a server, then you should already know which ports do what.


After you have what you want typed in, click on "Ok" to go back to the other window.

After you have all the services you need opened up, click on "Next".

The next window doesn't have a whole lot to it, and is fairly easy. By default, the pre-checked boxes are fine. If you don't know if you want to check the last box or not, leave it alone.

Click on "Next".

The next configuration window shows a few options for logging. Leave these alone unless you're sure.

Click "Next".

After you click on "Next" a window pops up saying it will save the configuration. Click on "Continue" and it saves your settings and restarts the SUSE2Firewall.



And now you're back at the main window. Next, click on "Security settings".


When you open the Security settings window, you'll have a few options for setting up some security on your system.

By default it has a custom level, which you will now be setting.

Click "Next".

The next window has password options. At the top where it says "Checks" click the box that says "Checking new passwords" which will keep users from setting bad passwords.


Next, in the Password Length section, you should probably raise the "Maximum" length up a few notches, as 8 is nothing. I raised mine to 25. You can also set some password change warnings here, which may come in handt if a lot of users are going to use the system.

Click on "Next".


The next section should be changed from default:

Where it says "Boot permissions" click on the drop down box where it says "Reboot" and select "Ignore" so no one can just reboot your system. This is especially important if you're running a server.

Under that, where it says "Automatic" you should select "Only Root". That way no one can just shut the system down.

Click "Next".

This window allows you to set how long of a delay there is if someone logs in and mistypes a password, or if someone is trying to guess passwords. The default is 3 seconds.

This can be left alone unless you have a nosey little brother or sister, or people like to try and guess your password, in which case you can set it to whatever you want.

After you have chosen your options, click on "Next".

The next section is the "Adding users" section. Unless you're sure, leave this alone. Click on the "Next" button.

The next window has a few more options, and some important ones.

The setting of file permissions will really have to depend on you. Easy is selected by default, but if you're trying to be secure, jsut click on the box and select the option entitled "Secure".


The next setting is for updatedb. This is run every night, and you can select which user runs the command. You won't be typing it if you select your own user name, it in fact just runs with permissions of whichever of the user names you tell it to run as.

I'd suggest leaving it at "Nobody". Most of the other options here should be left alone unless you knwo what you're doing.


After you have selected what you would like here, click on the "Next" button, and all the settings will be saved.








Chapter 3 : System





In this Chapter, you will be staying in YAST2, and clicking on "System" on the left hand side of YAST2, to open up more settings to play with.

Word of warning:

do NOT play with these settings unless I tell you to, or you know what you're doing. You can REALLY mess up your system from here.

OK, start by clicking on "Run Level Editor".

When you open that window, you see a few basic options, but that's not why I aske you to open it. you'ore going to now edit and possible shut down services running on SUSE Linux. Again, DO NOT SHUT DOWN SERVICES UNLESS I GIVE YOU THE OK. One wrong click and your keyboard stops working.

Now, in the window that popped up, click on "Runlevel properties" and wait for the window to load.

After the window has loaded, you should see a vast amount of information. these are the services/Daemons running on your system.

I'm going to help you excersize the Daemons you don't want/need.

This screen may look odd and hard to understand, but it's really not.

The left shows what service it is, and as you go to the right it gives information aboutt hat service, and the number indicate what run levels it starts up in automatically.

Start by scrolling down a little until you see "Joystick". click on that, and then, towards the bottom where you see "Start/Stop/Refresh" click on "stop".

You don't need this is you don't have a joy stick.

Next, scroll down a little more, and think to yourself "Do I run this machine as a server?".

If you answered yes, then you'll need a few of these more than others, but if you answered "No", then you can safely click on "Portmap" and stop it too.

The next one you should see after scrolling down a little is called "sshd".

If you don't need to log into this box from a remote computer, then you don't need this service running.

You can safely stop SSH.

In here, you also may start up Daemons if you need them, but don't do it if you don't need to, or don't knwo what that means.

After you have everything shut down that you don't need (Only what I told you to click on, and things you were sure of) you can click on the Finish button in the lower part of your screen.

It saves the configuration you just made, and then tells you about it with a pop up window.

Click "Ok" on the pop up, and then the window closes, and you'r done.

You've just made your SUSE Linux system a little more secure. Now, don't be fooled, this is no where near fool proof. You should read up on SUSE Linux. And maybe if people like this tutorial, I'll write another one to show you how to edit the more advanced parts of SUSE Linux.

+++++++++++++++++++++++++++++++++++++

Was this easy?

Did it help?

What could be added that I haven't planned on?


Did the tutorial flow good?

pooh sun tzu
July 30th, 2004, 01:17 AM
Nice rundown of the basic security principles regarding SUSE and very well dictated :) Learned a few things while reading it too.

gore
July 30th, 2004, 01:31 AM
Thanks man :) It was odd doing a tutorial that had nothing to do with installation of an OS, and I have only done that maybe 2-3 times, so I had to think of how to make it flow. Hopefully the next part in the series will have an even better flow, and much more information.

I'm putting them into smaller chunks, because well, it would be a monster like my OS paper which is being made still. That will really need to be split up. :)

Relyt
July 30th, 2004, 01:31 AM
^5 Gore,

Bookmarked this one. I use 8.2 Pro and looks like I'll be making some changes per your recommendations. Thanks for writting this one up!

cheers

Spyder32
July 30th, 2004, 01:53 AM
I'm no professional tutorial writer (as we all know) but hey, it was a good read. Pretty basic yet good and thorough information for instance:

Again, DO NOT SHUT DOWN SERVICES UNLESS I GIVE YOU THE OK. One wrong click and your keyboard stops working.

100% true. Also for the above, I find it great to alway's cover security update's. Good job man :)

thread_killer
July 30th, 2004, 02:30 AM
Have you considered cross posting this on a site like Just Linux (http://www.justlinux.com) or Linux Questions (http://www.linuxquestions.org)?

You're liable to hit a much wider audience of SuSE users.

By the way...This post brought to you by a highly tweaked SuSE 9.0 pro machine. :)

hypronix
July 30th, 2004, 02:46 AM
So when Novell ships my Linux kit I'll have a good starting point in this tutorial. Hopefully everything will run as smooth as this tutorial [;)] when I'm doing the set up... and yeah, I won't be doing only what you told us to do :P

Und3ertak3r
July 30th, 2004, 12:08 PM
Thanks Gore..

the informatin is helpful for a converting Whinduz user.. oops brain mash again..

almost just in time..

cheers

Wyatt
July 30th, 2004, 01:13 PM
I will say that within the last three months I have moved into the NIX environment. I am very pleased so far as to what I have learned. I started on SUSE and found your *TOOT* very interesting and informative. I would look forward to another segment of this. Thanks for your knowledge and time. Very much appreciated. Although I have now jumped full steam into OpenBSD 3.5 as a router for my home system. That is a bit cumbersome for a newly NIX user but I have set it up for basic routing right now and learning more on Packet Filter. thanks again!!!

gore
July 30th, 2004, 01:36 PM
Wow, thanks guys. This got a better responce than I could have even hoped for. Thanks. I'll get to the next one when I have a little more time. I'm currently getting ready for a shower and work. Heh, went to bed at a little after 2 in the morning, and got up at 7:30 AM. Heh, thanks guys.

kryptonic
July 30th, 2004, 01:38 PM
Good one as usual gore. Ill have to try this sometimes. Well when i finally get SuSE that is.

berkah
August 13th, 2004, 08:31 AM
Thanks a lot from Indonesia!
I am just "moving" to SUSE 9.1, and you tutorial was a great help!
Please, come with more like this one soon! :)

instronics
August 13th, 2004, 10:40 AM
Nice info there gore. Just about the SuSE firewall... i would recomend NOT to use yast2 for the firewall setup. I recomend in a shell, to goto /etc/sysconfig/SuSEfirewall2 and configure it by hand. Theres alot more detail in there that yast offers you. You can setup the SuSE firewall with GREAT details, including your own iptables rules. The yast option just gives you a very small basic selection.

Cheers :)


/edit

If the suse machine is just a personal box for use at home with no server functions, then the personal firewall that comes along is excellent. If its for a server, then the USER should know his way around the shell, vi, etc.... and setup the SuSEfirewall2 with the details needed/offered in the file itself, and not YAST. The file is commented with enough information to configure the firewall correctly. If someone does not understand the firewall config file, then he should not setup services.

Cheers :D

gore
August 13th, 2004, 01:54 PM
Instronics:

YAST2 has both basic and advanced set up for the fireall. When I start the next section for this I'll be showing that. The Basic set up is a quickie to get the system locked for normal use. After that, you stay in YAST2 and you can edit the system like you're saying from YAST2. All of the advanced options are still there, they are just in another part to YAST2.

The Firewall set up for basic usage is there for normal users, but like I said, when I add more to this tutorial, I'll be showing you where in YAST2 you can edit complete system configurations. You don't have to do it in Vi, YAST2 has the same options, and hey explain what each part is in there for, and things like that. You can edit /etc from YAST2 :)

tech_guru
October 22nd, 2004, 12:12 AM
Nice Post....Very informative...Will recommend it to my friends who are new to Suse...

secure_lockdown
October 22nd, 2004, 05:55 PM
it not bad at all. it's very basic - but okay. greenies given. :-)

idmismatch
January 14th, 2005, 05:00 PM
I'm very suprised you consider having an FTP server on your box to be a good thing. Most people I know would use scp instead. My boxes generally have only a few ports open:
tcp: 22 (ssh/scp and tunnelled vnc, mysql etc)
tcp: 80 (web services)
udp: 514 (syslog on logging server)

Certainly removal of portmap is a good thing, but given the choice I wouldn't even let the RPC software get installed.

I think the best message you've given is "keep up to date with security patches". As true in Linux as it is Windows and any other OS out there.

If you really want to be secure you're best starting off thinking that way when you install the machine.
* Install and USE tripwire/AIDE
* Install and MONITOR seccheck
* If other people have accounts consider running password crackers occasionally
* Don't let root log in remotely
* Don't let anyone su to root, use sudo instead

SuSE out of the box isn't bad at all, but I wouldn't trust it on the internet as it stands. Thankfully it's not hard to harden it a little (those five steps, off the top of my head are a start), and if you _really_ want to tie it down it's not impossible. Think about using Bastille, a script that takes you through a set of steps that will really make life harder for anyone trying to screw with your system.

Ultimately though....
* Monitor any security systems you use, or they're worthless
* Update security patches whenever appropriate

Looking forward to gore's next installment!

CXGJarrod
January 14th, 2005, 06:42 PM
No offense, but how is having a web port open better than an FTP port?

If you really want to be secure you're best starting off thinking that way when you install the machine.
* Install and USE tripwire/AIDE


Tripwire on a home machine? Isnt that a bit pricey?

idmismatch
January 14th, 2005, 10:44 PM
No offense taken ;-)

I didn't have a problem with opening the FTP port, it was running the FTP server I was objecting to. Sorry for any confusion caused, maybe I should have been more precise.

Yes, FTP servers can be secure, but unless you're after some anonymous FTP system I don't see why you wouldn't use scp instead. Scp offers you PPK authorisation and file compression, I don't know any FTP servers that have those features. I'm not saying that none do, I'm really saying I haven't looked at running an FTP server for a looong time.

Anyway, _is_ a web port secure?
Hell, I don't know. I'm running Apache and hoping bugs get fixed before they're used.

Redarding Tripwire... there _is_ a free version available. As it happens I use AIDE instead (as that's what I could get running from the rpm once upon a time), which offers basically the same funtionality.

gore
January 14th, 2005, 10:46 PM
Originally posted here (http://www.AntiOnline.com/showthread.php?threadid=260361#post817248) by idmismatch
I'm very suprised you consider having an FTP server on your box to be a good thing. Most people I know would use scp instead. My boxes generally have only a few ports open:
tcp: 22 (ssh/scp and tunnelled vnc, mysql etc)
tcp: 80 (web services)
udp: 514 (syslog on logging server)

Certainly removal of portmap is a good thing, but given the choice I wouldn't even let the RPC software get installed.

I think the best message you've given is "keep up to date with security patches". As true in Linux as it is Windows and any other OS out there.

If you really want to be secure you're best starting off thinking that way when you install the machine.
* Install and USE tripwire/AIDE
* Install and MONITOR seccheck
* If other people have accounts consider running password crackers occasionally
* Don't let root log in remotely
* Don't let anyone su to root, use sudo instead

SuSE out of the box isn't bad at all, but I wouldn't trust it on the internet as it stands. Thankfully it's not hard to harden it a little (those five steps, off the top of my head are a start), and if you _really_ want to tie it down it's not impossible. Think about using Bastille, a script that takes you through a set of steps that will really make life harder for anyone trying to screw with your system.

Ultimately though....
* Monitor any security systems you use, or they're worthless
* Update security patches whenever appropriate

Looking forward to gore's next installment!

FTP, which if you read, I use PureFTPd, which SUSE chroots by default, and I have mine set up where you need a log in name and password that I alone have to give you. I don't think I'm exactly opening the door to hackers there.

Password crackers are run each night along with the security scripts and all logs and script activities are emailed to me and the root account. (The more mails sent the harder it is for someone to clear them out.).

Root can only log in to whatever /etc/securetty says it can. Now guess what I actually left in there..... Actually I should have added that to this tutorial.

I do trust SUSE on the internet as it stands. Before SUSE has booted up, you can update it with all patches, and configure the firewall. All of this before it's even been booted for the first time. Bastille is not needed. harden_suse comes with SUSE Linux.

I'd put SUSE as one of the most secure OSs in the World. And not tomention YAST2 is probably the best admin tool ever made.

I do have plans for another tutorial like this one but with a lot more. I just haven't had the time.

idmismatch
January 14th, 2005, 11:02 PM
"FTP, which if you read, I use PureFTPd, which SUSE chroots by default, and I have mine set up where you need a log in name and password that I alone have to give you. I don't think I'm exactly opening the door to hackers there."

Okay, butthe password's sent cleartext. The chroot jail _is_ a good thing, but you'll still be left with files possibly being dumped on your machine that don't belong there. Not critical, perhaps, but I sure wouldn't want it!

The biggest problem you can have with all the logs being sent to you is do you have time to read them? I sure as hell don't for my own PC, but for work... well, it's my job, and I make time. This is the point I made about "USE" and "MONITOR". All the detection systems in the world won't help you if you don't read the warning they produce ;-)

Regarding root logging in.... here's a wee tip which I'm sure you (gore) know, but maybe others don't. In /etc/ssh/sshd_configmake sure you have a line reading:
PermitRootLogin no

I have a feeling that this might be the default in SuSE Pro 9.2, but it wasn't in SLES 8!

gore
January 15th, 2005, 12:51 AM
If there is a dude who can get passed two routers with hardware firewall, SUSEFirewall2, and the 4 other firewalled and updated boxes on this LAN, they deserve the account for FTP. It's not accessible onless you are in my house, on my LAN.

jm459
January 15th, 2005, 01:09 AM
Originally posted here (http://www.AntiOnline.com/showthread.php?threadid=260361#post817354) by gore
If there is a dude who can get passed two routers with hardware firewall, SUSEFirewall2, and the 4 other firewalled and updated boxes on this LAN, they deserve the account for FTP. It's not accessible onless you are in my house, on my LAN.

Boo, I'm behind you :D gore stop feeding me all this shit, I'm an old man, these drugs will kill me. Well maybe not :D

idmismatch
January 15th, 2005, 01:25 AM
Why the hell are you using FTP on your own lan?

ZomBieMann77
January 15th, 2005, 03:31 AM
does it matter? maybe he likes the way it feels between his toes.

gore
January 15th, 2005, 01:45 PM
Because backing up 70 gigs of porn and.... 100 gigs of "Completely legal movies and MP3s" not to mention system files, takes a REALLY long time, and a lot of CD-Rs which I don't always have. So I uplpad everything to my FTP server, which can handle 12 gigs in a couple of minutes, and then when I get CD-Rs, I burn them to media.

idmismatch
January 16th, 2005, 01:34 PM
Fair enough, you like FTP.

If you ever decide to work as a sysadmin you'll find that scp will be the preferred option for most file transfers on your machines, and rsync is a really good way of keping directory structures up to date/mirrored. Future reading:
* man scp (note the PPK authorisation and the filecompression)
* man rsync (note you'll now stop uploading files that hven't changed)

One way of ensuring a number of servers have identical configs, and a way of being able to roll back should you screw up is to use CVS or Subversion. I wish I'd found that out earlier!

I've been told that unison (http://www.cis.upenn.edu/~bcpierce/unison/) is a good file synchronisation tool is anyone here finds that rsync's not enoug, or if they have windows hosts. I've never used it, so you'll have to see for yourself.

Enjoy!