LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   changing current user without logging out (https://www.linuxquestions.org/questions/linux-newbie-8/changing-current-user-without-logging-out-330444/)

chibi 06-04-2005 08:49 PM

changing current user without logging out
 
Hello,

Hopefully a really simple question.

I have logged in as root and setup some files for a user. Lets pretend the user is named someguy. I change the ownership of the files so they are owned by someguy.

I want to execute one of the files, but that means the process will be owned by root and not by someguy right? So thats a problem..

What I would like to do, is just type a command like: changeuser someguy password and have it switch to that user. then when I am done type exit and then it goes back to root. it would be cool that because I am root i wouldnt need to know the password for that user. is there something like this thats possible?

or perhaps a way to execute the file as another user instead of root?

Thank you for your help, greatly appreciated :)

-Chibi

rickh 06-04-2005 08:59 PM

Certainly no problem to change to another user from root and execute a process ...
# su anotheruser anotheruserspassword
$ processname

A more interesting question (to me) would be can I start 2 Xwindows sessions owned by two different users?

How about about one user in workspace1 running an Xwindows app, and another user with his own Xwindows setup in workspace2?

ilikejam 06-04-2005 09:03 PM

Quote:

A more interesting question (to me) would be can I start 2 Xwindows sessions owned by two different users?
You can do this by doing 'startx' or 'xinit' as one user, then switching to another console, logging in as another user, and doing 'startx -- :1' or 'xinit -- :1'.

You can then switch between the X sessions using Ctrl-Alt-F7 and Ctrl-Alt-F8

Dave

chibi 06-06-2005 01:40 AM

Thank you for answering :)


All times are GMT -5. The time now is 07:26 PM.