Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Run non-root script as root with non-root environment Post 58826 by bubba112557 on Thursday 2nd of December 2004 02:18:48 PM
Old 12-02-2004
Run non-root script as root with non-root environment

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 with the sh command. I am not sure.

Thanks,

Mike
 

10 More Discussions You Might Find Interesting

1. Linux

how to access root priveliges if root password is lost

wish to know how to access root password it root password is forgotten in linux (1 Reply)
Discussion started by: wojtyla
1 Replies

2. AIX

Can't login root account due to can't find root shell

Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in. I'm using AIX 5L version 5.2... (2 Replies)
Discussion started by: neikel
2 Replies

3. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

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

4. Shell Programming and Scripting

Need to run a bash script that logs on as a non-root user and runs script as root

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

5. Solaris

Lost Root Password on VXVM Encapsulated Root Disk

Hi All Hope it's okay to post on this sub-forum, couldn't find a better place I've got a 480R running solaris 8 with veritas volume manager managing all filesystems, including an encapsulated root disk (I believe the root disk is encapsulated as one of the root mirror disks has an entry under... (1 Reply)
Discussion started by: sunnyd76
1 Replies

6. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

7. SuSE

Auditors want more security with root to root access via ssh keys

I access over 100 SUSE SLES servers as root from my admin server, via ssh sessions using ssh keys, so I don't have to enter a password. My SUSE Admin server is setup in the following manner: 1) Remote root access is turned off in the sshd_config file. 2) I am the only user of this admin... (6 Replies)
Discussion started by: dvbell
6 Replies

8. Shell Programming and Scripting

Find users with root UID or GID or root home

I need to list users in /etc/passwd with root's GID or UID or /root as home directory If we have these entries in /etc/passwd root:x:0:0:root:/root:/bin/bash rootgooduser1:x:100:100::/home/gooduser1:/bin/bash baduser1:x:0:300::/home/baduser1:/bin/bash... (6 Replies)
Discussion started by: anil510
6 Replies

9. UNIX for Dummies Questions & Answers

Can you gain root privileges if the suid program does not belong to root?

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

10. UNIX for Beginners Questions & Answers

Can a root role change the root password in Solaris 10?

i do not have root on a solairs 10 server , however i do have the root role, i was wondering if I can change the root password as a a role with the passwd command? I have not tried yet. and do i have to use the # chgkey -p afterwards? i need to patch is why i am asking. thanks (1 Reply)
Discussion started by: goya
1 Replies
Poet::Environment(3pm)					User Contributed Perl Documentation				    Poet::Environment(3pm)

NAME
Poet::Environment -- Poet environment SYNOPSIS
# In a script... use Poet::Script qw($poet); # In a module... use Poet qw($poet); # $poet is automatically available in Mason components # then... my $root_dir = $poet->root_dir; my $file = $poet->path("some/file.txt"); my $path_to_script = $poet->bin_path("foo/bar.pl"); my $path_to_lib = $poet->lib_path("Foo/Bar.pm"); DESCRIPTION
The Poet::Environment object contains information about the current environment and its directory paths. PATH METHODS
root_dir Returns the root directory of the environment, i.e. where .poet_root is located. path (subpath) Returns the root directory with a relative subpath added. e.g. if the Poet environment root is "/my/env/root", then $poet->path("somefile.txt"); ==> returns /my/env/root/somefile.txt bin_dir comps_dir conf_dir data_dir db_dir lib_dir logs_dir static_dir Returns the specified subdirectory, which by default will be just below the root dirctory. e.g. if the Poet environment root is "/my/env/root", then $poet->conf_dir ==> returns /my/env/root/conf $poet->lib_dir ==> returns /my/env/root/lib bin_path (subpath) comps_path (subpath) conf_path (subpath) data_path (subpath) db_path (subpath) lib_path (subpath) logs_path (subpath) static_path (subpath) Returns the specified subdirectory with a relative subpath added. e.g. if the Poet environment root is "/my/env/root", then $poet->conf_path("log4perl.conf"); ==> returns /my/env/root/conf/log4perl.conf $poet->lib_path("Data/Type.pm"); ==> returns /my/env/root/lib/Data/Type.pm OTHER METHODS
app_class Returns the full class name to use for the specified class, depending on whether there is a subclass in the environment. e.g. $poet->app_class('Cache') will return "MyApp::Cache" if that module exists, and otherwise "Poet::Cache". This is used internally by Poet to implement auto subclassing. app_name Returns the app name, e.g. 'MyApp', found in .poet_root. conf Returns the Poet::Conf object associated with the environment. Usually you'd access this by importing $conf. current_env A class method that returns the current (singleton) environment for the process. Usually you'd access this by importing $poet. OBTAINING $poet SINGLETON In a script: use Poet::Script qw($poet); In a module: use Poet qw($poet); $poet is automatically available in components. You can also get it via my $poet = Poet::Environment->current_env; CONFIGURING ENVIRONMENT SUBDIRECTORIES
Any subdirectories other than conf_dir can be overridden in configuration. e.g. # Override bin_dir env.bin_dir: /some/other/bin/dir With this configuration in place, $poet->bin_dir ==> returns /some/other/bin/dir $poet->bin_path("foo/bar.pl") ==> returns /some/other/bin/dir/foo/bar.pl SEE ALSO
Poet AUTHOR
Jonathan Swartz <swartz@pobox.com> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Jonathan Swartz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-14 Poet::Environment(3pm)
All times are GMT -4. The time now is 07:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy