LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-11-2019, 01:45 PM   #1
barnarasta
Member
 
Registered: Oct 2012
Location: Spain
Distribution: Debian Squeeze-Wheezy-stretch-Buster \/ Unix SCO 5.7. in production, not for play.
Posts: 38

Rep: Reputation: 1
Command who in STRECH


Good afternoon.
I have a small problem with the "who" command in a Debian Stretch.
When I do a "who i am" in Debian wheezy
the result is:
Quote:
gestion pts/0 2019-03-11 17:17 (juan)
And when I do it from STRETCH, the output is:
Quote:
gestion pts/0 2019-03-11 17:17 (194.1.80.205)
The difference is that the name I have in /etc/hosts comes out in Wheezy, and the IP comes out in STRETCH.

That is an inconvenience for me, because in another process I extract the name with "awk" to reuse it in other processes.

I was googling the weekend without finding any clear reference,
I show you the -files- that I think are involved in the subject.

An extract of the /etc/hosts is:
Quote:
127.0.0.1 localhost
194.1.80.206 milinux.com milinux
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
###################
194.1.80.205 juan
/etc/resolv.conf
Quote:
search milinux.com
nameserver 80.58.0.33
nameserver 80.58.61.250
nameserver 80.58.61.254
/etc/nsswitch
Quote:
# /etc/nsswitch.conf

#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat
gshadow: files

hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis
Can someone tell me what may be happening?
or how to solve it?

Thank's
 
Old 03-12-2019, 07:06 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
did you check the version of who?
if you need the hostname why don't you use the command hostname?
 
Old 03-12-2019, 03:39 PM   #3
barnarasta
Member
 
Registered: Oct 2012
Location: Spain
Distribution: Debian Squeeze-Wheezy-stretch-Buster \/ Unix SCO 5.7. in production, not for play.
Posts: 38

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by pan64 View Post
did you check the version of who?
who --version ====> coreutils 8.26
Quote:
if you need the hostname why don't you use the command hostname?
When you enter as a client on a server with -for example, ssh or telnet- the command "hostname -I" gives the result of the server, not the client.
 
Old 03-13-2019, 01:39 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
Ok.
I think who will return the ip address when it cannot find the hostname.
you can check by the command: host <ip>.
 
Old 03-14-2019, 10:41 AM   #5
barnarasta
Member
 
Registered: Oct 2012
Location: Spain
Distribution: Debian Squeeze-Wheezy-stretch-Buster \/ Unix SCO 5.7. in production, not for play.
Posts: 38

Original Poster
Rep: Reputation: 1
Again, when you enter as a client on a server with "ssh" the orders refer to the server, not the client.
You can check it yourself by installing the "ssh" service and the "putty" desktop client.

apt-get install openssh-server openssh-client putty

Then you go into "putty" as I show in the image and verify.

Check also that it does not work in Slackware or Red Hat.

https://www.amazon.es/photos/share/s...ZZXu1dKcyUwoO6
 
Old 03-14-2019, 01:32 PM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
I don't understand what are you speaking about.
You entered who and an ip address was returned instead of hostname. This is your original problem. I think you can check the host where you executed who did not find the hostname, that's why was the ip address used. You can check it easily with the command host <ip address> - exactly in the same window where you executed the command who.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc to compile without warnings on Debian Testing Strech? Xeratul Debian 4 06-25-2016 11:28 AM
Display in monitor strech dzul2411 Linux - Newbie 3 07-23-2008 11:59 PM
Blit and Strech Blit bianchi Programming 2 12-15-2005 02:04 AM
Dell Latitude D600 strech problem koenig Linux - Laptop and Netbook 0 10-14-2004 07:48 AM
dual monitors - how can I strech desktop xanas3712 Linux - Newbie 3 04-30-2004 09:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration