LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 12-13-2016, 01:20 PM   #16
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694

No worries. You need to end the runuser line with a closing quote '

Code:
runuser -l exg85 -c '/export/home/exg85/reports/RUNUSEREXG85.sh'
 
1 members found this post helpful.
Old 12-13-2016, 01:21 PM   #17
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
No permissions issue, had that resolved. The user 'exg85' has permission to execute every line in the script, but only when I do it manually. Put it in a script, it doesn't work
 
Old 12-13-2016, 01:24 PM   #18
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@szboardstretcher...tried adding the closing quote, error I get is:

could not open session
 
Old 12-13-2016, 01:25 PM   #19
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
What do you get with this?

runuser -l exg85 -c 'ls'
 
1 members found this post helpful.
Old 12-13-2016, 01:30 PM   #20
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
Actually I made a mistake. I need to run this script:

#!/bin/bash
runuser -l exg85 -c '/export/home/exg85/reports/LINUX2WIN.sh'


That allows me to run this script as the user 'exg85':


#!/bin/bash

TODAY=$(date +%Y%m%d)
DIR0=//export/home/exg85/reports
DIR2=//export/home/exg85/reports/audit/reports

mkdir -p "${DIR2}"/"${TODAY}"
find "${DIR0}" -mindepth 1 -maxdepth 1 -type f -name "audit.xlsx" -mtime +1 -exec mv -t "${DIR2}"/"${TODAY}"/ "{}" \+
 
Old 12-13-2016, 01:32 PM   #21
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@szboardstretcher........when I run

runuser -l exg85 -c 'ls'

under the username 'oracle' I get this:

could not open session
 
Old 12-13-2016, 01:35 PM   #22
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
deleted

Last edited by szboardstretcher; 12-13-2016 at 01:40 PM.
 
1 members found this post helpful.
Old 12-13-2016, 01:37 PM   #23
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Can you sudo to that user from the oracle user?

As oracle 'sudo su - exg85' or 'sudo -u exg85 whoami'
 
1 members found this post helpful.
Old 12-13-2016, 01:38 PM   #24
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
God knows I wish I could, but it would be a VERY HIGH security breach and once they find out, I will quickly get booted. The nature of my job is very secret and very sensitive!!
 
Old 12-13-2016, 01:40 PM   #25
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Dude! NO PROBLEM at all. Just doing my best to help. Some of my clients can, and some of my clients cant. Doesn't hurt to ask though. Try my code i mentioned in #23
 
Old 12-13-2016, 01:41 PM   #26
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@szboardstretcher..no I can't. it asks for the 'oracle' password and I suspect that it is for the root user and I don't have the password for that
 
Old 12-13-2016, 01:42 PM   #27
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
You are VERY helpful and I appreciate it!!!!!
 
Old 12-13-2016, 01:45 PM   #28
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Ok.. How about:

Code:
(As oracle) su exg85 -c "yourscript.sh"
This will run the yourscript.sh as the user exg85.

No problem. On that note.. Please click the scales in the bottom left of each of my posts you find helpful,.. this increases my reputation and is one of the perks we enjoy for giving our time and effort. Its how we say thank you to one another!

Last edited by szboardstretcher; 12-13-2016 at 01:47 PM.
 
1 members found this post helpful.
Old 12-13-2016, 01:49 PM   #29
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@szboardstretcher.......... it asks for a password, but when I put in both the password for 'oracle' and 'exg85' it says incorrect password. I typed them in VERY SLOOOOOOOOWLY too! 8.))
 
Old 12-13-2016, 01:54 PM   #30
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I don't see scales but I clicked all your posts that were helpful where it says "Did you find this post helpful?" It's on the bottom right hand
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command logging ideas needed! ssh user@host "echo logme" ZiGz Linux - Security 6 04-15-2009 02:08 AM
Logging in as user with SU priviledge bigshots Red Hat 4 03-05-2009 12:48 PM
IP/USER Logging scalforama Linux - Software 3 08-21-2007 12:22 AM
command logging esdeedee Linux - Security 2 05-24-2006 12:29 PM
Prevent a user from logging into X? sorrodos Linux - Security 6 06-26-2004 03:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration