On Jueves 17 Septiembre 2009 02:15:12 Mohsen Alimomeni escribió: > 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? > You are right, and this is because common programs doesn't login. However, for log about ssh, check on /var/log/secure.... And, for running things, "ps - edalf" or "ps axu" or "pstree -u". > Regards, > -- > __ \ /_\\_-//_ Mohsen Alimomeni > And one more thing out of topic. Fedora 4 is outdated, vulnerable and is not releasing updates anymore, not even critical updates. If you are not using this server as penetration testing lab pourporse, i strongly recommend you to install the latest version. -- Ing. Aaron G. Mizrachi P. http://www.unmanarc.com Mobil 1: + 58 416-6143543 Mobil 2: + 58 424-2412503 BBPIN: 0x 247066C1
Attachment:
signature.asc
Description: This is a digitally signed message part.