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!
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.
Are you saying that at login you want them to change the IP address then exit? Or are you saying in additional to their normal user functions you want them to be able to change the IP address.
For either you'd need to work out the command line syntax to do the modification (or launch the GUI that does the modification) which is different for different distros of Linux. Ideally you'd create a script to do what you want.
To have them do the login, change and exit you can modify their login script (e.g. $HOME/.bashrc) to run an "exec" on the script - this makes it replace the shell with the script and once the script completes and exits it exits completely from the system. (For this to work you also need to disable traps and shell escapes.)
For the normal user setup and addition of IP address change you should setup sudo to run the script/command that does the IP change. Sudo is designed to allow non-root users to run specific root commands as if they were root without actually becoming the root user or needing to know the root password. Typing "man sudo" and "man visudo" will give you more information. The key point if you write a script is to insure that it is only writable by root user so that they can't change it to add other commands. (This also means the script should be in a protected directory so that the user can't change permissions on it.)
Yes. As noted previously you can give them access to do sudo. See the sudo and visudo man pages.
After granting access they'd run "sudo service network restart" instead of just "service network restart". That prompts for their login rather than root's but then runs the command as root. (Be sure when specifying the command that you specify the full command and not just "service" to avoid having them do other stop/starts of key services.
Also you can avoid sudo and hard boot altogether by simply having them hit "ctrl-alt-del" on the console. That will perform a soft boot (normal shutdown and restart).