Re: get logged in username

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mohsen Alimomeni wrote:
> Hi,
>
> How can I get the logged in username under remote command execution? I
> am using openssh version 4.0 under fedora core 4.
>
> more explanation:
> when I do "ssh admin@host", I can get the username "admin", by the
> command "who -m", since there is tty which the username is assigned to
> it. But suppose I want to execute a remote command "ssh admin@host
> myprog", I want to get the username inside the myprog. The command
> "who -m", doesn't work because no tty is created for the user.
> How can I get the username in this case?
>
> Regards,
> --
> __ \ /_\\_-//_ Mohsen Alimomeni
>

If all you need is a tty to get 'who -m' to work, why not use 'ssh -tt
admin@host' to allocate a tty to the session?

- --
# include <stddisclaimer.h>
/* Kevin Brott <Kevin.Brott@xxxxxxxxx> */


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11-svn5139 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkq0NPwACgkQHPfX3it8TYsrlgCgzQ56KRA8rlk5hBn/QMHYzlRD
DtgAn2WfNCgq2NutZUwbcNlppA6RleKh
=BaIg
-----END PGP SIGNATURE-----


[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux