-1

Team,

today i did some mistake on customer production server. Unfortunately i fired hostname 90 on root terminal. then i typed hostname and it returned 90 instead of actual hostname .

It was typo while typing hostname -I. (Checking for IP address )

What happens when you type "hostname 90" on root terminal.?

Thanks.

Siva Krishna
  • 11
  • 1
  • 8

1 Answers1

0

You can run strace hostname 90 to see what is going on, perhaps as a non-root user to avoid breaking the system. Near the end of the output is this:

sethostname("90", 2)                    = -1 EPERM (Operation not permitted)

(Here I didn't run the command as root, hence the EPERM error.)

So the hostname program calls sethostname system call with the argument from the command line. If the system administrator runs this command, it changes the host name to 90, without further prompts, so a lot of things will go wrong after this point.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92