Linux - NewbieThis 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.
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.
I have received help from another user concerning Oracle Shell Scripting (thank you BW-userx) and I'm trying to log in as a different user other than what I'm currently logged in as.
Example: I'm logged in as user 'oracle' when the script first starts, but right in the beginning of the script I need to be logged in as 'eric'. from what I read, I tried using CONNECT (domain/username and username/domain) with no success. I'm assuming that is the syntax.
Basically I'm asking how can I log in as a different user using comman d line only, if it's even possible?
@lazydog.......I get the response "could not open session". I tried "sudo -u username" with no success. If I have to, and if it is available I am willing to pass my username and password in the script.
What does the script look like, and how are you running it?
What do you mean by logging in as a user? Do you mean logging in at the terminal as 'user' and running a command as another user? Or do you mean using ssh to login and run a script as another user?
Last edited by szboardstretcher; 12-13-2016 at 12:54 PM.
Before the script is ran, Im logged in as a sudo user 'oracle'. I need to log off as 'oracle' right in the beginning of the script before the rest of the script is ran.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.