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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
12-13-2016, 01:59 PM
|
#31
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
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.
|
12-13-2016, 02:02 PM
|
#32
|
Senior Member
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Rep:
|
Quote:
Originally Posted by trickydba
@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.
|
12-13-2016, 02:42 PM
|
#33
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
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
|
|
|
12-13-2016, 02:43 PM
|
#34
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
and yes I can log in normally using 'exg85'
|
|
|
12-13-2016, 02:44 PM
|
#35
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Mine(try this):
Code:
su -u exg85 -c 'ls'
Yours:
notice that there isn't a lone - dash like your command. Any difference?
|
|
1 members found this post helpful.
|
12-13-2016, 02:57 PM
|
#36
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
Using
su -u exg85 -c 'ls'
I get
su: invalid option -- 'u'
Without the 'u' it asks for a password
|
|
|
12-13-2016, 02:59 PM
|
#37
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
Quote:
Originally Posted by trickydba
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.
|
12-13-2016, 03:08 PM
|
#38
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
@Reuti.........They seem different.
Boy, ya'll are some smart cookies! Ya'll must have RHEL certs!
|
|
|
12-13-2016, 03:22 PM
|
#39
|
Senior Member
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Rep:
|
Quote:
Originally Posted by trickydba
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.
|
12-13-2016, 08:21 PM
|
#40
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
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.
|
All times are GMT -5. The time now is 02:30 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|