LinuxQuestions.org
Help answer threads with 0 replies.
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:59 PM   #31
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

Thank you. Scales are here: http://imgur.com/a/Pon0V Sure you dont see them? Thats very odd.

Using 'su -u exg85' would require the password for exg85.

Can you log in as exg85 normally? This is very strange. Do you have something like pam, selinux, or sssd/winbind that is stopping users from logging into other users?

Last edited by szboardstretcher; 12-13-2016 at 02:02 PM.
 
1 members found this post helpful.
Old 12-13-2016, 02:02 PM   #32
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by trickydba View Post
@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.))
OK, was unaware you don't have root's password. Try this instead;
Code:
 su - exg85 -c 'command'
This will ask for exg85's password before it is run.
 
1 members found this post helpful.
Old 12-13-2016, 02:42 PM   #33
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I tried:

su - exg85 -c 'command'

I get:

su: incorrect password

I used my EXACT password for logging in as 'exg85' in linux AND the password for 'exg85' in Win
 
Old 12-13-2016, 02:43 PM   #34
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
and yes I can log in normally using 'exg85'
 
Old 12-13-2016, 02:44 PM   #35
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
Mine(try this):
Code:
su -u exg85 -c 'ls'
Yours:
Code:
su - exg85 -c 'ls'
notice that there isn't a lone - dash like your command. Any difference?
 
1 members found this post helpful.
Old 12-13-2016, 02:57 PM   #36
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
Using

su -u exg85 -c 'ls'

I get

su: invalid option -- 'u'


Without the 'u' it asks for a password
 
Old 12-13-2016, 02:59 PM   #37
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by trickydba View Post
I tried:

su - exg85 -c 'command'

I get:

su: incorrect password

I used my EXACT password for logging in as 'exg85' in linux AND the password for 'exg85' in Win
It can depend on the setting in /etc/pam.d/su resp. su-l and login. Are these different?

You are not root, but could root setup a special case for you: there can several options be configured for sudo (i.e. in /etc/sudoers.d/somefile) which allows to execute just exactly one command as a different user, and only as this user. Or even switch the user automatically when user A issues sudo fubar and it will run always as user B - no password, as long as the actual commandline matches the coded one in /etc/sudoers.d/somefile (use absolute paths to avoid any other behavior). Also an email can always be send if this sudo case is used.
 
1 members found this post helpful.
Old 12-13-2016, 03:08 PM   #38
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@Reuti.........They seem different.

Boy, ya'll are some smart cookies! Ya'll must have RHEL certs!
 
Old 12-13-2016, 03:22 PM   #39
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by trickydba View Post
I tried:

su - exg85 -c 'command'

I get:

su: incorrect password

I used my EXACT password for logging in as 'exg85' in linux AND the password for 'exg85' in Win
If you run the command as yourself does it work? I mean log in as yourself, not oracle, and run the command. I'm trying to see where the disconnect is as on my system it works and I can run a command as any other user from my personal account.
 
1 members found this post helpful.
Old 12-13-2016, 08:21 PM   #40
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
I have resolved the issue using scp and a package I had installed called expect. Here is my code:

#!/bin/bash
expect -c "
spawn scp -p file.xlsx exg85@hostname://export/home/exg85/reports/destinationoffile
expect "assword"
send "mypswd\r"
expect "reports]$"
spawn scp -p file2.xlsx exg85@hostname://export/home/exg85/reports/destinationoffile
expect "assword"
send "mypswd\r"
expect "reports]$"
send "exit\r"
interact "

Insecure,yes. I plan on changing the permissions of the script.I appreciate everyone's help. Yes, the admins didn't really address the permissions issue and I apologize to everyone for that. This is a great forum with great people and I hope nobody feels unappreciated!

I used this method before and it seems to work good
 
1 members found this post helpful.
  


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 10:42 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