Re: temp hostname change (430 Views)
Reply
Regular Advisor
rleon
Posts: 125
Registered: ‎07-27-2006
Message 1 of 8 (445 Views)
Accepted Solution

temp hostname change

We have an app team that insist that they need to change a hostname to install their app.

 

Its just as simple as running the hostname command no neeed to edit /etc/password  , /etc/rc.config.d/netconf ..

 

Needless to say their change occur in the middle of the night ... and then once they are done we are to change the hostname back.

 

We tried to change the varible HOSTNAME but when the hostname command is ran it still shows the old hostname.


My question is .. is there a varible to change the hostname?

Or would we have to give them sudo access to change the hostname back and fourth.

 

 

Trusted Contributor
donna hofmeister
Posts: 191
Registered: ‎08-29-2008
Message 2 of 8 (444 Views)

Re: temp hostname change

why not just modify dns and/or /etc/hosts to add an additional name?

Acclaimed Contributor
Torsten.
Posts: 23,451
Registered: ‎10-02-2001
Message 3 of 8 (439 Views)

Re: temp hostname change

Try

 

# hostname

 

# hostname mynewhostname

 

# hostname


Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Honored Contributor
Horia Chirculescu
Posts: 829
Registered: ‎07-11-2009
Message 4 of 8 (430 Views)

Re: temp hostname change

Giving sudo access to change the hostname of any unix machine is a security risk.

 

Some of your services could depend on that name. I wonder if the app team must install a new app every night becouse if they only have to do that let's say once per month you should assist them to do that. Better talk with them and try to understand why they have this requirement from you. Maybe there is one missunderstanding of the problem.

 

 

Best regards from Romania,
Horia.
Honored Contributor
Doug O'Leary
Posts: 815
Registered: ‎05-25-2005
Message 5 of 8 (413 Views)

Re: temp hostname change

Hey;

 

>.# hostname mynewhostname

 

You should also use "uname -S ${newhostname}"  although, like the others, I find this quite squirrelly.  There's something not right going on there if they need to change the hostname in order to install an app...

 

HTH;

 

Doug O'Leary


------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Occasional Visitor
Pallavi P
Posts: 1
Registered: ‎07-21-2010
Message 6 of 8 (387 Views)

Re: temp hostname change

[ Edited ]

you can use "set_parms hostname" command to change hostname .

 

HP Pro
Hiren N Dave
Posts: 97
Registered: ‎04-10-2006
Message 7 of 8 (383 Views)

Re: temp hostname change

> you can use "set_parms hostname" command to change hostname .

 

It will change hostname on permanent basis...

I am an HP Employee

Was this post useful? - You may click the KUDOS! star to say thank you.
Acclaimed Contributor
Dennis Handly
Posts: 25,294
Registered: ‎03-06-2006
Message 8 of 8 (377 Views)

Re: temp hostname change

>It will change hostname on permanent basis.

 

Yes but you can "permanently" change it back.  :-)

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.