How can I hide my IP from linux who command

SuperKrish

I am a Linux system admin, I will login every system of my local network. I don't want my IP to show up via who command. For example, if someone enters:

$ who

it reveals my IP. Is there any way to hide my IP from the who Linux command?

[EDIT by chrips]

This is important for those concerned with their personal utility servers being hacked! Obviously, you would want to hide your current home IP from an attacker lest they find a vector on you!

rudimeier

Most simply you could make the utmp log files non-world readable. This is even mentioned in the utmp man page:

Unlike various other systems, where utmp logging can be disabled by removing the file, utmp must always exist on Linux. If you want to disable who(1) then do not make utmp world readable.

like this:

sudo chmod go-r /var/log/wtmp /var/run/utmp
who        # shows nothing, not even an error!
sudo who   # still works for root
rudi     :0           2017-04-18 19:08 (console)

So this would disable who completely, not only skip IP addresses.

Another idea (maybe a bit silly) to hide only the IPs could be to let your ssh server listen at another port (1234) and on localhost only. Then run a "proxy" (socat, netcat) to forward from public_ip:22 to localhost:1234:

  1. change ssh server config, /etc/ssh/sshd_config:

    Port 1234

  2. run a proxy on ssh server machine:

    socat TCP-LISTEN:22,fork TCP:localhost:1234

Now all utmp logs (who, last) will show the same and useless localhost IP.

Note maybe your users could still see the real connections via netstat. Instead of the userspace proxy (socat) you could also setup iptables NAT and MASQUERADING rules for the incomming ssh traffic. Or you could always use an extra "ssh hop" to always login from the same IP. This is left as an exercise for the reader. ;)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I track who SSH'es into my linux machine?

From Dev

How can I hide the IP address associated with my domain name?

From Dev

How can I get my public IP address from the command line, if I am behind a router?

From Dev

How can I determine the IP address I get from torify (tor) in shell command line (linux)?

From Dev

How do I get my IP address from the command line?

From Dev

How can i stop someone from spamming my console using the write command in linux

From Dev

How can i remove "<MAXROWS/>" string from all 30 files in my directory through linux / unix command?

From Dev

How can I hide a few files from my phpstorm project

From Dev

How can I find my shell version using a Linux command?

From Dev

How can I find the procedure or the query and the user who deleted from my table

From Dev

how can I shutdown my system from the console with a command?

From Dev

How can I copy a folder from the Linux command line?

From Dev

how to prevent other users on the network who know my IP from accessing pages other than I want them to?

From Dev

how to prevent other users on the network who know my IP from accessing pages other than I want them to?

From Dev

how can i execute command who have input

From Dev

how can i execute command who have input

From Dev

How can I allow all these 16384 (IP range FROM & TO) IP in a single command?

From Dev

How can I hide the command I'm using in an MSBuild Exec task from console output?

From Dev

How can I remotely control a linux box from my Mac?

From Dev

How can I know who is using my wireless?

From Dev

How can I see who and when logged remotely to my computer?

From Dev

How can i check if my host command in script got a valid ip

From Dev

How do I hide the IP & port in my URL in the browser?

From Dev

How to get the IP of a user who executed a command?

From Dev

How can I force my machine to get an IP Address from my router?

From Dev

How can I automatically rename, copy and delete files in linux for my ip camera webcam?

From Dev

How can I hide depots from my view in p4v?

From Dev

How can I bind a command from my IntemsControl list to my main ViewModel?

From Dev

How can I debug my command controller?

Related Related

  1. 1

    How can I track who SSH'es into my linux machine?

  2. 2

    How can I hide the IP address associated with my domain name?

  3. 3

    How can I get my public IP address from the command line, if I am behind a router?

  4. 4

    How can I determine the IP address I get from torify (tor) in shell command line (linux)?

  5. 5

    How do I get my IP address from the command line?

  6. 6

    How can i stop someone from spamming my console using the write command in linux

  7. 7

    How can i remove "<MAXROWS/>" string from all 30 files in my directory through linux / unix command?

  8. 8

    How can I hide a few files from my phpstorm project

  9. 9

    How can I find my shell version using a Linux command?

  10. 10

    How can I find the procedure or the query and the user who deleted from my table

  11. 11

    how can I shutdown my system from the console with a command?

  12. 12

    How can I copy a folder from the Linux command line?

  13. 13

    how to prevent other users on the network who know my IP from accessing pages other than I want them to?

  14. 14

    how to prevent other users on the network who know my IP from accessing pages other than I want them to?

  15. 15

    how can i execute command who have input

  16. 16

    how can i execute command who have input

  17. 17

    How can I allow all these 16384 (IP range FROM & TO) IP in a single command?

  18. 18

    How can I hide the command I'm using in an MSBuild Exec task from console output?

  19. 19

    How can I remotely control a linux box from my Mac?

  20. 20

    How can I know who is using my wireless?

  21. 21

    How can I see who and when logged remotely to my computer?

  22. 22

    How can i check if my host command in script got a valid ip

  23. 23

    How do I hide the IP & port in my URL in the browser?

  24. 24

    How to get the IP of a user who executed a command?

  25. 25

    How can I force my machine to get an IP Address from my router?

  26. 26

    How can I automatically rename, copy and delete files in linux for my ip camera webcam?

  27. 27

    How can I hide depots from my view in p4v?

  28. 28

    How can I bind a command from my IntemsControl list to my main ViewModel?

  29. 29

    How can I debug my command controller?

HotTag

Archive