Linux System Administration
When you booted up your Linux machine, you instantly became the System Administrator. You may have fewer users, or you may not be connected to a network, but many of the functions are similar. Perhaps the only difference is that you know whom to complain to when the system is not configured properly. As this series continues, you should be able to get a good grasp on what you have to do to make your system efficient, secure and user-friendly. And you'll know how to do it.
When you have your machine set up, log in as root. By default, the root user has no password. So when you are asked for a password, just hit the ENTER key. This makes it easy to log in, as you don't have to go hunting around for a password after you set your system up. The disadvantage to this is that anyone can log in as root and have free access to your system. The first thing you must do is to change the password for root. To do this, use the passwd command. The root's password must be impossible to guess by normal users. Also, user accounts should be protected with just as much security. Here are some hints for good passwords:
1. Do not include anything significant to you, such as a nickname, phone number, your last name, etc.
2. Change your password often. (especially if you are on a network).
3. Do not use a word that can be found in a dictionary.
4. Make your password at least 6 characters long, with a mix of letters, digits, and/or punctuation characters.
5. Do not tell anyone your password and don't write it down anywhere.
6. Change your password often (just in case you forgot).
To change your password, type: passwd
Type in your password; then you will be prompted to type it in again just to make sure you spelled it right the first time. If the two passwords you entered do not match, your password is not changed. When you type in your password, it will not be shown on the screen. This is to prevent anyone around you from seeing your password.
A sample password changing run looks like this:
# passwd Changing password for root Enter the new password (minimum of 5 characters) Please use a combination of upper and lowercase letters and numbers. New password: Re-enter new password: /#
Now that your system is more secure, make your system more user-friendly. One way of doing this is by changing two files, /etc/issue and /etc/motd. The /etc/issue file contains the message that you see above the login: prompt. This messag e sometimes contains the name of the site and the operating system. For example, my /etc/issue file reads:
linux ver. 0.99.14 (enry)
The next file you'll want to change is /etc/motd. This file is the one that gets seen every time you log in. Motd stands for Message Of The Day. This file usually contains a welcome screen and messages of general importance for all users. For example, my /etc/motd file has:
** Welcome to enry ** Good News! SLIP will be available Real Soon Now. Send mail to root for more information.
These are just examples. Your setups may look similar to this, but they don't have to be. There are other ways of making the system easier for other users (and yourself). For starters, you may want to look at the man pages for bash, X, and any other kinds of utility programs you may be using. The man pages are a good source of information.
The idea of a drive in UNIX is much different than it is under DOS. The Linux (and UNIX) way of looking at drives is as follows: Each physical drive can be split into partitions (or filesystem), and each partition can be mounted into a directory.
Because of this, there are no drive letters as in DOS; there is no drive A:, B:, C:, and so on. The users will be dealing with only one drive, and everything is shown in terms of directories to the user. You could have one filesystem for the root directory and other files (the / directory), another filesystem for user commands (the /usr directory) and another filesystem for user space (the /usr/users, /home, or /user directory). For example, I have three partitions that I use: one is for the / directory, one is for the /usr directory, and the third one is for the /home directory.
When I cd into the /usr or /home or / directories or any of their subdirectories, it is just like using cd from DOS to change to a subdirectory. I do not have to switch drive letters; I just have to use cd and I automatically go to that filesystem.
There are a few advantages to using this system. First, you can add more total space to the system. If you notice that the /usr/X386 subdirectory will take up more space than /usr has, you can create a new filesystem from the unused portion of your drive and mount that partition to /usr/X386. Second, all file operations are invisible to both the user and the user's programs. DOS needs a drive letter and a directory. Linux just needs a directory.
Linux refers to physical drives, such as the 3.5 inch floppy drive, as files in the /dev directory. For example, the first drive (called A: in dos) is /dev/fd0 in Linux. The fd refers to the fact that it is a floppy drive, and the 0 means that it's the first of that kind of device. Hard drives are referred to in two different ways. One way is the physical drive itself, the first or second (or more) drive. The other way is by partition on that physical drive. Hard drive entries in /dev are prefixes with hd to signify hard drive, followed by an an “a” for the first physical drive “b” for the second physical drive, etc. After that, a number specifies the partition within the physical drive. The first partition is 1, the second partition is 2, etc. SCSI devices follow the same format, only their prefix is s. You can remember that asSCSI device.
In order to help you think in Linux, here are a few DOS to Linux ways of thinking of the same drive:
DOS LINUX A: /dev/fd0 B: /dev/fd1 C: (assuming first /dev/hda1 partition on the first hard drive) E: (assuming second /dev/hdb2 partition on the second hard drive)
In my next article I'll discuss making our own filesystem (in ext2 and xiafs formats), and I'll go over some of the entries in the inittab file. If you have any questions or comments about my article, I can be reached through e-mail at: henry@acca.nmsu.edu or via mail through Linux Journal.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Linux Systems Administrator
- RSS Feeds
- Validate an E-Mail Address with PHP, the Right Way
- Introduction to MapReduce with Hadoop on Linux
- Weechat, Irssi's Little Brother
- New Products
- Developer Poll
- Reply to comment | Linux Journal
2 hours 7 min ago - Reply to comment | Linux Journal
2 hours 52 min ago - Didn't read
3 hours 3 min ago - Reply to comment | Linux Journal
3 hours 8 min ago - Poul-Henning Kamp: welcome to
5 hours 18 min ago - This has already been done
5 hours 19 min ago - Reply to comment | Linux Journal
6 hours 4 min ago - Welcome to 1998
6 hours 52 min ago - notifier shortcomings
7 hours 16 min ago - heroku?
8 hours 53 min ago




Comments
Changing Root password
When trying to change my root password by using the "sudo -su" command i get this:
bash: sudo-su: command not found
then i am asked for my current UNIX? Which is defeating the whole object as i have no idea what the UNIX password is... please help mw someone
duh
sudo-su: command not found <<<<< no kidding.....
try it with a space in it :P
sudo -su