Skip to main content

How to change localhost name

More
19 years 4 months ago #9179 by apit
hi there..
which file need to be modify to change localhost at shell promt
example:


[localhost@localdomain]#
change to
[apit@apit]#


i've try edit file /etc/host but it will disappear when reboot the pc..need your guide..thanks
More
19 years 4 months ago #9183 by Rocco5757
hai,

this is ballu.i think the way to change the username i.e is LOGNAME is through vi ~/.bash_profile and editing the environment variables.And other may goto /etc and type 'vi passwd' change the user name and what ever u want there in the list and save the changes.i think it should work.


bye
balluf
More
19 years 4 months ago #9185 by sahirh
I quote from 'man hostname'

NAME
hostname - show or set the system's host name
dnsdomainname - show the system's DNS domain name

SYNOPSIS
hostname [-v] [-a] [-d] [-f] [-i] [-s]
[-y]

hostname [-v] [-F filename] [hostname]

hostname [-v] [-h] [-V]

dnsdomainname [-v]

DESCRIPTION
Hostname is used to either set or display the current host or domain name of the system.
This name is used by many of the networking programs to identify the machine. The domain
name is also used by NIS/YP.

GET NAME
When called without any arguments, the program displays the current names:

hostname will print the name of the system as returned by the gethostname(2) function.

dnsdomainname will print the domain part of the FQDN (Fully Qualified Domain Name). The com-
plete FQDN of the system is returned with hostname --fqdn.

SET NAME
When called with one argument or with the --file option, the commands set the host name or
the NIS/YP domain name.

Note, that only the super-user can change the names.

It is not possible to set the FQDN or the DNS domain name with the dnsdomainname command
(see THE FQDN below).

Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
More
18 years 10 months ago #12726 by linuxmanju
.. /etc/sysconfig/network
.............................. Huh
More
18 years 10 months ago #12733 by monsky
same with linuxmanju.. edit the /etc/sysconfig/network.. then /sbin/service network restart to take effect and log on again. you will see the changes.
More
18 years 10 months ago #12734 by monsky
i forgot .. also you must be 'root' to do that as sahirh has said. :)
Time to create page: 0.142 seconds