when i open a terminal session of my SUSE server using puTTy and type "who am i" then it displays my local pc ip address.
root@LinuxSUSE1> who am i
root pts/8 2012-03-28 16:02 (192.168.134.213)
But when i open a terminal session of my SUSE server using Xmanager's Xstart and type "who am i" then it doesnt display the ipaddress.
Note: Xstart is similar to Putty. It comes built in with xserver "Xmanager"
root@LinuxSUSE1> who am i
root pts/8 2012-03-28 16:02
The problem is, i'm unable to find the ip address of the users who are logged into my server.
Any help...
Ok,
I'm not a SUSIE admin, but this what I would do.
To see who is on the server use one of the following commands; whois, who, w
example:
# w
The w command gives you the most info.
I would then do this to see what process they are running
# ps -ef|grep username
To see what ip address the server has do this
# ifconfig -a
This will give you the if address.
You can view the system logs to where the user made his connection from.
I hope this helps
thanks bitlord for your reply. But none of your suggestions helped.
w command does give more info. but its not displaying the users terminal ip address.
ps -ef|grep username gives only the process run by the user.
ifconfig -a give servers ip address and
systemlogs has only system activities recorded, it has no details about ipaddress of the user logged in.
this what I get from the w command
[antone@server ~]$ w
08:35:20 up 23 days, 22:16, 7 users, load average: 0.06, 0.09, 0.09
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
antone pts/2 :1.0 06Mar12 11.00s 0.33s 2:59 gnome-terminal
antone pts/1 :1.0 05Mar12 21:27m 0.08s 0.08s bash
antone pts/3 :1.0 07Mar12 19:49m 0.12s 0.12s bash
antone pts/4 :1.0 09Mar12 1.00s 0.15s 0.06s w
bob pts/6 :2.0 09Mar12 19days 0.29s 0.04s ssh randes@10.1.0.121
bob pts/5 :2.0 09Mar12 19days 0.07s 0.07s ksh
antone pts/7 :1.0 21Mar12 44:50m 0.09s 0.09s bash
The bolded line is not what your looking for? The system logs will tell you who is making a connection. Example: user bob connection from 10.1.0.21. I have seen failues and successful logins in the logs.
Sorry if the info was not helpful. Most of my experience is Solaris and RHEL. I have found most of the stuff I do on RHEL works on SUSIE.
yes W isnt displaying the ipaddress.
Can you pls tell me which log file should i look into ?
I haven't managed SuSE systems in centuries, but have you tried the 'lastlog' command? It may display all the information (including IP Address) that you're looking for.
lastlog | grep -v Never
When I'm on a Linux box, mostly RHEL, the log is here.
/var/log/messages
As the guy above says you can also do this.
[antone@server ~]$ sudo last
This shows you everyone who is logged in and gives you the hostname or IP
No guys. Even this doesnt seem to work.
The suggested commands are displaying the IP address if only the user uses PUTTY and if the user uses xstart there is no IP displayed. Below is what i see.
user1@LinuxSUSE1:~> last
user1 pts/4 192.168.134.213 Fri Mar 30 17:03 still logged in
user2 pts/4 Fri Mar 30 17:02 - 17:03 (00:01)
user3 pts/12 Fri Mar 30 16:34 still logged in
user4 pts/7 Fri Mar 30 15:29 still logged in
user8 pts/15 Fri Mar 30 11:52 - 14:37 (02:45)
user1 pts/14 Fri Mar 30 10:45 still logged in
and
in2nix4life command too didnt help.
I suspect xstart is using some customized xserver technology to display the terminal, though it resembles putty in functionality behind the scenes its different (i guess).
Very odd. I'm curious if this could be related to either your terminal type or terminal size.
Can you respond back with the results of the following commands:
env | grep TERM
stty size
Xstart Terminal
================
user1@LinuxSUSE1:~> env | grep TERM
TERM=xterm
XTERM_SHELL=/bin/bash
XTERM_VERSION=XTerm(208)
COLORTERM=1
user1@LinuxSUSE1:~> stty size
24 80
Putty terminal
================
user1@LinuxSUSE1:~> env | grep TERM
TERM=xterm
COLORTERM=1
user1@LinuxSUSE1:~> stty size
28 80