Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I've got my IRC server along with services running nicely on my machine.
But the problem is, either I can run it as root, which is somewhat dangerous, due to permissions that come along with it. Or, I can run it as myself. But then I have to log in, and that's not what I want.
My idea is pretty much taken from the Apache world of servers:
The service has it's own username and group, under which it runs, and has access to it's files.
But I couldn't find a how-to, in any of my Linux books, adressing this problem.
Could someone give me a tip, how to make applications run as a different user? Say, it's started by root, but then changes to 'ircd' or something.
actually, I tryed being /sbin/nologin or /bin/false, but then I can't run programs with the su command, the solution cs-cam suggested.
the shell is /bin/sh now, and unfortunatelly, I _can_ log in, but only while being root with the su command. A Password is not given, I have a "*" (asterisc) in the place where the password should go, in the shadow file (standart for system-users).
It works that way, and I think I'm gonna leave it like that.
It's not the fully professional way, though.
I'd definately want to be the shell /sbin/nologin, and force the program to change it's UID afterwards.
Are you sure this can't be done with a shell command?
I wrote a shellscript for the /etc/init.d and /etc/rcX.d/ directory hierarchy.
There you can use the functions, provided by /etc/init.d/funtions shellscript, one of those is called "daemon". It supports starting processes as a different user, by simply calling bash with that user. Since it is root in the beginning, bash obeys this directive.
The /etc/init.d/ structure, is a Red-Hat thing. The tool chkconfig works together with that. Don't know how to solve it on other systems, except by writing your own startup script with some algorythms from the functions-script.