Re: How to get original user (linux 2.4.20 kernel)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jesper, thanks for the quick reply.
Answer to your questions:

Q1 Why?
I am doing some project where in we have a requirement for logging
current user as well as the actual user (who logged into the system).
From security point of view such information mke sense.

Q2 If you could do that, then "su" would kind of loose its meaning...
IMO "su" provides us the functionality to switch between different
users i.e. different access levels. Moreover "su" does not mean that
information about the previous user is lost; remember when we type
"exit" it takes us to previous user.

One interesting thing that i came across few minutes back. There are
two command "whoami" and "who am i".
Try following sequence of commands:
i   ) Login as "root"
ii  ) su - aaa
iii ) whoami  /* This will output aaa */
iv ) who am i /* This will output root */
So it seems there is some way.

Regards,
Dang

On 5/5/06, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote:
On 5/5/06, Linux Dang <linuxdang@xxxxxxxxx> wrote:
> Hi,
>     I am looking for some way to extract original user for a given
> process. For example,
> A user types following command
>
> i   ) guest log's in as "aaa"
> ii  ) su - "bbb"
> iii ) su - "ccc"
> iv ) ./a.out
>
> I want to find the actual user i.e. "aaa".

Why?


> Can this be acheived on Linux 2.4.20?

I don't think so, but I'm not 100% sure.

If you could do that, then "su" would kind of loose its meaning...

--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html



--


Regards,
Linux Dang

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux