Posts

Showing posts from April, 2007

How to Change the Root Password to Get Into a Linux Box

Image
This procedure assumes you have console access, and are authorized to make changes to accounts on the machine, including root. If you own the machine, you can boot into single user mode, and change the password, or create an account. If using grub (you should see a blue bootup screen), press "a", "space", "1", "enter" a 1 That will boot to single user mode. Then you can change the root password passwd Then reboot Ctrl-Alt-Del You should create user accounts other than root. Use the useradd command. useradd someone passwd someone rhce linux

RHCE Study Notes - SMTP

Image
Study notes for any exam are difficult enough to find, but RHCE material seems even more scarce. This article tells how to prepare for one of the objectives, which is configuration of an SMTP server. RHCE Study Notes I wrote up some study notes as I was preparing for the RCHE exam. Here are some quick notes based on the official RedHat objectives , labs, and possible questions I thought might be reasonable requests. SMTP Related Questions install sendmail, sendmail-cf, sendmail-doc (optional) Q: Configure mail server to accept internet email A: modify /etc/mail/sendmail.mc 1) cd /etc/mail 2) vi /etc/mail/sendmail.mc search for 127.0, put dnl at the front of the line 3) make or m4 sendmail.mc > sendmail.cf service sendmail restart Q: Mail alias A: modify /etc/aliases, run newaliases Q: Receive mail for DomainX.example.com A: modify sendmail mc as above, and add domain to /etc/mail/local-host-names ...

How to Run a Bash Command on All Items in a List

Image
For Linux / Unix Follow as instructed For Windows Download cygwin from http://cygwin.com For instructions, see this article: http://systemnotesorg.blogspot.com/2007/04/use-cygwin-to-run-linux-on-windows.html Two Easy Steps for One-Liners e.g., you have a list of servers, and would like to do something, such as ping each one, or check their IP address. Here is a quick two-step process, with a one-line shell script that can be run from the command line. 1) Create a Text file, with one hostname per line 2) Run a for loop on the file $ cat servers.txt server01 server02 server03 $ for host in `cat servers.txt`;do host $host;done server01.example.com has address 10.10.10.10 server02.example.com has address 10.10.10.11 server03.example.com has address 10.10.10.12 $ If you want different output, you can use awk, but that's another topic. Notice a few things about this one line script. 1) Each command is separated by a semicolon ";" 2) The ba...

Use Cygwin to Run Linux on Windows

Yes, not only can you run Linux from a CD -- http://systemnotesorg.blogspot.com/2007/04/how-to-get-started-with-linux.html , but you can also install it in Windows, and run it as a Windows program. You get a standard linux bash shell, and even X, with a little configuration. What Is Cygwin? (from http://cygwin.com ) Cygwin is a Linux-like environment for Windows. It consists of two parts: A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality. A collection of tools which provide Linux look and feel. The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, with the exception of Windows CE. Note that the official support for Windows 95, Windows 98, and Windows Me will be discontinued with the next major version (1.7.0) of Cygwin. What Isn't Cygwin? Cygwin is not a way to run native linux apps on Windows. You have to rebuild your application from source if you want it to r...

Which Certifications are Important?

CNE Not as popular as it once was. MCSE One of the most popular has been the MCSE. CCNA It is always good to have some network knowledge. RHCE One of the most challenging exams in the industry. All hands-on lab exam. A+ Not very difficult, but shows some knowledge of hardware, and is a prerequsite for HP exams HP APS HP Acredited Platform Specialist. Requires CNE, or MCSE and A+ as prerequsites, but is a fairly easy exam that deals mainly with hardware. Other Specialties Oracle, Citrix, etc. There is plenty of demand for MCSE's, but experience counts as well. RHCE is another important one, as is the CCNA. Other certs are useful, but more so in smaller companies, or as a consultant. You will need more experience to get into a big company, but jobs tend to be more specialized. You would either be a server admin, network admin, or dba, whereas in a smaller company you might be all three. Another important thing to help get interviews is a college degree. You can use some of your...

How to Get Started with Linux

Have you always wanted to find out more about linux, but were not sure where to start? Here is a little information on where to find, and how to run and / or install a linux distribution. What is Linux? Linux is the kernel, or core part of an operating system that is free from any software licenses. Free to download, and install on as many machines as you like. Here's an explanation from http://www.gnu.org/ The GNU Operating System - Free as in Freedom What is the GNU project? The GNU Project was launched in 1984 to develop a complete Unix-like operating system which is free software: the GNU system. Variants of the GNU operating system, which use the kernel called Linux, are now widely used; though these systems are often referred to as "Linux", they are more accurately called GNU/Linux systems. GNU is a recursive acronym for "GNU's Not Unix"; it is pronounced guh-noo, approximately like canoe. Trying Linux First, you may not have known that ...

How to Start a Blog

Image
...and maybe make some money. An article I posted on http://systemnotesorg.blogspot.com discusses how to get more traffic to your site. http://systemnotesorg.blogspot.com/2007/04/search-engine-optimization.html Now let's concentrate on how to set up a blog. With blogger, you don't have to know any html, but if you do, it helps. Getting Started First go to http://www.blogger.com and create a blog. If you already have a gmail account, you have completed the first step. It is really simple, and they walk you through it. Think of a name, and what you would like to write about. O.K., so you have a blog, now what? There is a book title that should help you keep on topic -- " No One Cares What You Had for Lunch " Then start posting. You can set up your blog to receive email, so posting is very easy. Just send an email to the address you set up under settings / email. Making money Well, keep posting something useful, but If you want to make money, don't wa...

Search Engine Optimization

Sure this blog is more about systems and programming than it is about marketing, but if you're building a website or blog, you probably have at least some interest in SEO ( Search Engine Optimization ). Basically, that means having other quality sites link back to your site, which is what makes it appear higher in search engines such as google Here are some things to check out: 66 Ways to Build Links in 2007 . If you are interested in making money from your blog, or learning how to get more traffic, check out http://problogger.net . Try a google search on seo, if you want to learn more. And don't forget about the excellent webmaster tools at google. http://www.google.com/support/webmasters and specifically, How can I improve my site's ranking? -- http://www.google.com/support/webmasters/bin/answer.py?answer=34432&hl=en

Using bash and sed to Modify a Text File

Image
This shell script demonstrates how to write to a text file, and then modify the contents. #!/bin/sh # modfile.sh # by ScottM, 04/12/2007 # demonstrates writing text to a file, and then using sed to modify it. TESTFILE=test.txt FRUIT=banana # add some content to the file (note: file will be overwritten) echo "apple" > $TESTFILE # modify the content sed -e "s/apple/& $FRUIT/g" -i $TESTFILE # sed uses the "s" option, which uses regular expressions to search and replace text # "s/apple/" means search for any lines that contain the characters "apple" # "& " means use the results of whatever was found # "/& $FRUIT/g" -- replace "apple" with "apple banana", # the g is for global, or all lines containing the pattern # output: # $ cat test.txt # apple banana # $ Sed One Liner This is really only a one line script, commonly referred to as a on-liner, so we don't really need a...

HowTo Install Multi Gnome Terminal using Yum

Multi Gnome Terminal Install Note: This procedure is for non-standard, unsupported software. The dag repository is outside of Redhat's control, but has some very useful software. Since multi-gnome-terminal has several dependencies, it is easier to install using yum. First, Install Yum * Install yum from your distribution $ rpm -Uvh /RPMS/rhel-3-i386-as/yum-2 .2.0-1.noarch.rpm * Modify /etc/yum.conf Standard yum.conf for rhel-3-U6 (change as required): [main] cachedir=/var/cache/yum debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=0 [rhel-3-U6-i386-as] name=Red Hat Enterprise Linux 3 Update 6 i386 AS baseurl= http://yum.mydomain.com/rhel-3-U6-i386-as/ * Then, add the dag repository to /etc/yum.conf [dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl= http://apt.sw.be/redhat/el3/en/i386/dag Now, Install and Configure multi-gnome-terminal 1. Install multi-gnome-terminal 1. yum inst...

Using nmap to Generate Host Lists

Image
An easy way to get a list of hosts from a single domain that you are a part of, is to query DNS host -l mydomain.com But that is not always practical. Sometimes you have machines that are in different domains, but they all are part of a network you manage. Rather than trying write a script that pings hosts and reports the output, just use nmap for a very fast scan. To scan all hosts in a list of subnets 1) Create a subnets.dat file with one subnet on each line: $ cat subnets.dat 192.168.0.* 192.168.1.* 2) Run nmap with the subnets.dat file as input $ nmap -sP -R -iL subnets.dat Reading target specifications from FILE: subnets.dat Starting nmap V. 3.00 ( www.insecure.org/nmap/ ) Host (192.168.0.0) appears to be down. Host box1.mydomain.com (192.168.0.1) appears to be up. Host box2.mydomain.com (192.168.0.2) appears to be down. Host box3.mydomain.com (192.168.0.3) appears to be up. Host (192.168.0.4) appears to be up. ... Notice how names are resolved ...