02-13-2008
Make program only run by root
Hi all, i hope i got this in the right place, what i am trying to do is make a program only run by root, ie
for instance user fred is logged in and uses firefox, what id like to do is change that so that when fred wants to use firefox he will be asked to enter root password before he is allowed to use it, is this possible and if so how, if anyone can help could they make it simple as im not very good
at this, i would be most gratefull for any help please.
10 More Discussions You Might Find Interesting
1. Solaris
not sure what the problem is, when I go to /home and enter command mkdir i get this error
mkdir chris
mkdir: Failed to make directory "chris"; Operation not applicable
im root.... (3 Replies)
Discussion started by: csaunders
3 Replies
2. UNIX for Dummies Questions & Answers
All,
I want to run a non-root script as the root user with non-root environment variables with crontab. The non-root user would have environment variables for database access such as Oracle or Sybase. The root user does not have the Oracle or Sybase enviroment variables. I thought you could do... (2 Replies)
Discussion started by: bubba112557
2 Replies
3. UNIX for Advanced & Expert Users
I want to know what i can set up so that root user can read everything. On my Solaris systems root can read the following directory.
drwxrwx--- 408 icsrc icarc0 36864 Aug 21 07:24 dev
drwxrwsr-x 7 icsrc icarc0 4096 Aug 4 1998 test
But on my linux systems it gets:
# cd dev
bash: cd:... (4 Replies)
Discussion started by: frankkahle
4 Replies
4. UNIX for Dummies Questions & Answers
hi
i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help
Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies
5. AIX
dears,
good day.
i need to be able to take a mksysb for a machine running aix 6.1.5 without the root credentials and also without using sudo
any advice ? (2 Replies)
Discussion started by: islam.said
2 Replies
6. UNIX for Dummies Questions & Answers
Hello every body,
I need to make a constant variable to the root such as #PS1="I am Amer" and so on.
I know if i am a user,I can make it fixed from #vi .profile
HOW to make it fixed for the root?
Thanks in advance
BR
Ahmed Amer
Cairo,Egypt (7 Replies)
Discussion started by: ahmedamer12
7 Replies
7. Shell Programming and Scripting
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies
8. Shell Programming and Scripting
So I have a script that runs as a non-root user, lets say the username is 'xymon' .
This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root.
in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
Discussion started by: damang111
2 Replies
9. UNIX for Advanced & Expert Users
I have a series of configuration files to deliver to multiple unix environments (dev, test, bench, prod etc). However I don't to modify them for each environment.
The files are text which currently contain this type of directory information
IN=/DVT/ms/sas/reception/PIL_QPA_SID/GSPIN001... (5 Replies)
Discussion started by: clarcombe
5 Replies
10. UNIX for Dummies Questions & Answers
I had a question in my test which asked where suppose user B has a program with 's' bit set. Can user A run this program and gain root privileges in any way?
I suppose not as the suid program run with privileges of owner and this program will run with B's privileges and not root. (1 Reply)
Discussion started by: syncmaster
1 Replies
chroot(8) System Manager's Manual chroot(8)
NAME
chroot - Changes the root directory of a command
SYNOPSIS
/usr/sbin/chroot directory command
DESCRIPTION
Only root can use the chroot command. The chroot command changes the root directory from / to the specified directory when the command
executes. (The command specified includes both the command name as well as any arguments.) Consequently, the root of any path (as indicated
by the first / (slash) in the pathname) changes to directory and is always relative to the current root. Even if the chroot command is in
effect, directory is relative to the current root of the running process.
Several programs may not operate properly after chroot executes. You must ensure that all vital files are present in the new root file
system and the relevant pathnames for the files map correctly in the new root file system.
For example, the ls -l command fails to give user and group names if the new root file system does not have a copy of the /etc/passwd and
/etc/group files. If the /etc/passwd and /etc/group files in the new root file system represent different user and group names, then the
output from the ls -l command will be based on those names, not the ones for the system's own name database. Utilities that depend on
description files produced by the ctab command may also fail if the required description files are not present in the new root file system.
The chroot program uses the execv() function to invoke the specified command. As a consequence, the command specified must be an exe-
cutable binary, not a shell script. Further, if the program requires indirect loading (for example, due to unresolved symbols requiring
use of a shared library), then /sbin/loader as well as any files it requires (for example, shared libraries) must be present in the new
root file system in the appropriate locations.
EXAMPLES
To run a subshell with another file system as the root, enter a command similar to the following. Note in this example, the file system is
on the /dev/disk/dsk13a device and is mounted to /mnt/dsk13a: chroot /mnt/dsk13a /sbin/sh The command shown in the previous example spec-
ifies a change from the current root file system to the one mounted on /mnt/dsk13a while /sbin/sh (which itself is relative to the new root
file system) executes. When /bin/sh executes, the original root file system is inaccessible. The file system mounted on /mnt/dsk13a must
contain the standard directories of a root file system. In particular, the shell looks for commands in /sbin, /bin, and /usr/bin (among
others) on the new root file system.
Running the /sbin/sh command creates a subshell that runs as a separate process from the original shell. Press to exit the subshell and
return to the original shell. This restores the environment of the original shell, including the meanings of the current directory (.) and
the root directory (/). To run a command in another root file system and save the output on the initial root file system, enter a command
similar to the following. Note in this example, the file system is on the /dev/disk/dsk13a device and is mounted to /mnt/dsk13a:
chroot /mnt/dsk13a /bin/cc -E /u/bob/prog.c > prep.out
The previous command runs the /bin/cc command with /mnt/dsk13a as the specified root file system. It compiles the /mnt/dsk13a/u/bob/prog.c
file, reads the #include files from the /mnt/dsk13a/usr/include directory, and puts the compiled text in the prep.out file on the initial
root file system. To create a file relative to the original root rather than the new one, use this syntax and enter:
chroot directory command > file
CAUTIONS
If special files in the new root have different major and minor device numbers than the initial root directory, it is possible to overwrite
the file system.
FILES
Specifies the command path.
RELATED INFORMATION
Commands: cc(1), cpp(1), ls(1), sh(1)
Functions: chdir(2), chroot(2) exec(2) delim off
chroot(8)