Starting up with a different user


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Starting up with a different user
# 1  
Old 03-11-2002
Question Starting up with a different user

Hi,

I am a newbie to linux and hopefully you guys can hlep me.

I installed tomcat and I created a script by ln -s /xyz........ tomcat. When I restart the server it startup but it start up with root. I created a new user and group also called tomcat. I want tomcat to be the owner of tomcat when it startup automatically.

Any ideas of how I can accomplish this task?

Thanks
# 2  
Old 03-11-2002
chown user:group file

for example:

chown tomcat:tomcat file

if tomcat is a directory, you can do a recusive owner change like this:

chown -r user:group file

hope this helps.
# 3  
Old 03-11-2002
tomcat is the owner and the group of all the directory.

chown -R tomcat tomcat
chgrp -R tomcat tomcat
chmod 750 -R tomcat

this is what i've done and root is still the owner after a reboot. root is starting up all the services and how can this be possible??

thanks
# 4  
Old 03-12-2002
Well, it's kind of tricky. Only root can open a port in the range of 1-1024. So the common http port, 80, can only be opened by root. But many server implementations, such as Apache httpd, can have the root process listen on port 80, then hand the incoming data off to a non-priveleged process (Yes this is a very basic explanation of this, but it'll give you just the basics of what's going on).

A quick search on Google will bring up a couple of results, such as this one:
http://www.samag.com/documents/s=115...101d/0101d.htm
Check farther down the page... he even includes a sample startup script that will run the process as a non-root user. Also, many time, the service docs will detail how to begin the server as a non-priveleged use. Check the man pages.

Hope this helps.
# 5  
Old 03-12-2002
great info....

when i installed rh linux 7.2 with the dns server.
it created a named user and group.

when i did a ps aux it shows named running with named as the owner, how is that possible?

named group id is below 100, could that be it?

thanks again
# 6  
Old 03-13-2002
I believe that it starts as root, (in many cases) drops into a chroot'ed environment, then drops it's privs and switches user to "named". So it's actually started as root, binds to the needed port, then drops to "named" permissions.

I may be way off, but I think that's it, generally speaking.
# 7  
Old 03-13-2002
thanks for that link, it helped me a lot.

xNYx
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

2. Solaris

Starting X on Solaris 11?

Hi friends, Hope everyone is fine and doing well. I have just installed Solaris 11, and everytime I boot my machine, I face the command prompt. Could you please tell me how I can setup the graphical environment, like gnome kde etc.??? Thanks in advance! (5 Replies)
Discussion started by: gabam
5 Replies

3. UNIX for Advanced & Expert Users

Determining if user is local-user in /etc/passwd or LDAP user

Besides doing some shell-script which loops through /etc/passwd, I was wondering if there was some command that would tell me, like an enhanced version of getent. The Operating system is Solaris 10 (recent-ish revision) using Sun DS for LDAP. (5 Replies)
Discussion started by: ckmehta
5 Replies

4. UNIX for Advanced & Expert Users

problem starting a process on solaris from other user

Hi Gurus, I have a server that has to users. 1) root 2)net1 there are several processes running on my server one of the process is CMIS_STACK process which is a compiled C code when this process goes missing then i restart this process manually in the following manner ... (2 Replies)
Discussion started by: asalman.qazi
2 Replies

5. Shell Programming and Scripting

Starting script without ./ name or sh name

Hi, i want to start my script only by the name of it. $ scriptName normaly i have to use ./scriptName oder sh scriptName is there a way to do that in bash or sh ? (13 Replies)
Discussion started by: Turrican
13 Replies

6. Shell Programming and Scripting

Starting over

I am re-learning UNIX and want to download Unix to my lab for studying on the road. Any suggestions? Got several books, but need to run scripts :rolleyes: (2 Replies)
Discussion started by: DudeMan
2 Replies

7. UNIX for Dummies Questions & Answers

just starting! got some questions

I just got a book on how to use UNIX but it says to type in your host but what's the name of the host that i type in? And after that where do I get my user id and password for that host?:confused: (1 Reply)
Discussion started by: animae64sm
1 Replies

8. UNIX for Dummies Questions & Answers

Starting X?

I just installed FreeBSD 4.5 and I want to find out how I can start and run X? When I boot I get taken to the command line. Xconfigurator doesn't want to work. (2 Replies)
Discussion started by: AMDPwred
2 Replies

9. UNIX for Dummies Questions & Answers

starting a server

i am currently am planning to start a webserver to host a community of webpages, but i need help getting started? anyone have any sites or advice for me? thanks! (1 Reply)
Discussion started by: bowlofrice
1 Replies

10. UNIX for Dummies Questions & Answers

Starting up

:confused: I have put together an old machine with a 386DX CPU (40MHz) with 8Mb of RAM and a 160Mb hard disk. One guy told me that its still suitable for UNIX. Can enyone give me some hints on how to start? (1 Reply)
Discussion started by: msm
1 Replies
Login or Register to Ask a Question