Ubuntu: Difference between revisions
m Ubuntu 22.04 Tag: visualeditor |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
# To '''permanently''' change the computer name<br>Edit <code>/etc/hostname</code> and <code>/etc/hosts</code> | # To '''permanently''' change the computer name<br>Edit <code>/etc/hostname</code> and <code>/etc/hosts</code> | ||
# Restart hostname service < | # Restart hostname service <syntaxhighlight lang="bash"> | ||
$ systemctl restart systemd-logind.service | $ systemctl restart systemd-logind.service | ||
</ | </syntaxhighlight> | ||
# Use ''hostnamectl'' with ''set-hostname'' flag. < | # Use ''hostnamectl'' with ''set-hostname'' flag. <syntaxhighlight lang="bash"> | ||
$ hostnamectl set-hostname NEW_NAME_HERE | $ hostnamectl set-hostname NEW_NAME_HERE | ||
</ | </syntaxhighlight> | ||
= Version specific = | = Version specific = | ||
* [ | * Ubuntu 22.04 LTS | ||
**[https://linuxconfig.org/how-to-setup-sftp-server-on-ubuntu-22-04-jammy-jellyfish-linux How to setup SFTP server on Ubuntu 22.04] |
Latest revision as of 07:54, 31 August 2023
Change hostname without a restart
- Last tested on Ubuntu 16.04 (2018-04-23)
- To permanently change the computer name
Edit/etc/hostname
and/etc/hosts
- Restart hostname service
$ systemctl restart systemd-logind.service
- Use hostnamectl with set-hostname flag.
$ hostnamectl set-hostname NEW_NAME_HERE
Version specific
- Ubuntu 22.04 LTS