第一种    临时修改使用  hostname   youname
                 该命令只是临时生效,重新起动后恢复原有主机名;
[root@RST ~]# hostname youname
[root@RST ~]# su
[root@youname ~]#
第二种      永久修改,重新启动后不会变更;
                   第一步:
                   修改[root@RST sysconfig]# pwd
                             /etc/sysconfig
                    目录下的network文件
[root@RST ~]# vi /etc/sysconfig/network
                     NETWORKING=yes
                     NETWORKING_IPV6=no
                     HOSTNAME=youname
                     第二步:该步修改的主机名为DNS解析使用;
                      修改[root@RST ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             youname
                      第三步:
                    [root@RST ~]# hostname youname
                    [root@RST ~]# su
                    [root@youname ~]#