Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Create a script that would automate adding users. The script SHOULD NOT use the functionality "useradd" that comes with the system, to create users. Each user should be added manually
Creating the password should also be incorporated in the script. That means, when you call the script to create a user, you also give it the password value, and then, your script will create the user and also create the password without prompting you for anything.
Ex:
Assume the name of your script is create_users . Then the following command:
./create_users smith 1001 120 initpassvalue "Alex Smith" /home/smith /bin/bash
will create a user named smith, with UID 101, add to primary group 120, home directory /home/smith, information about the account being "Alex Smith", with the bash shell as the default login shell and with the initial password set to initpassvalue. A .profile file and a .login file should automatically be copied into the home directory, every time a user is created.
The system will incorporate the shadow password file. The password should automatically have the default values for the following:
passwd length should be at least 8 characters
The password should be valid for 3 months
Can anyone provide any clues or hints for me? thanks in advance!
Sounds like a test question, or well, they said no "useradd", try to acuire a source for useradd, it might help, I think it uses echo redirected directly to a shadow password file, let me see in Linux Journal, they had a similar thingy, but the user had no password and ability to gain root privileges.
I know what these numbers are, but I am not telling you, because I am hungry (kidding), try to find out yourself. What it does it creates the user with username eviluser with uid and gid set to 0, and there's no encrypted password which goes to /etc/shadow, so if it's done as root, now any user can gain root access just typing
/bin/su - eviluser
Good luck on this one, so as for encryption I think pam utils package is the solution, so keep on reading man pages and you'll get your launch.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.