What is the path and host name after the Linux user logs in?

Source: Internet
Author: User
Keywords Linux user login host name
Tags aliyun examples host host name hostname html linux login
When we use putty, SECURECRT, or other terminals to log on to Linux, how do we know the path and host name after landing?

Examples are as follows:



[Root@localhost ~]# pwd
/root


[Root@localhost ~]# hosthttp://www.aliyun.com/zixun/aggregation/11696.html ">name
Localhost.localdomain

To change the name of a host:

[Root@localhost ~]# hostname www.ithov.com
[Root@localhost ~]# hostname
Www.ithov.com

But this method is temporary, as long as the system reboot will be ineffective!

For permanent entry, we need to edit the configuration file/etc/sysconfig/network

[Root@localhost ~]# Vi/etc/sysconfig/network
Networking=yes
Hostname=localhost.localdomain

Change the Hostname=localhost.localdomain to the host name you need!

Then use the service receptacle restart to make it effective

[root@www ~]# Service Receptacle Restart
Shutting down interface eth0: Device status: 3 (Disconnected)
Determine]
Close Loopback interface: [OK]
Pop-up loopback interface: [OK]
Pop-up interface eth0: Active connection Status: activated
Active connection path:/ORG/FREEDESKTOP/NETWORKMANAGER/ACTIVECONNECTION/1
Determine]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.