Ubuntu 20.04如何更改用户名

产品简介
本文适用于所有rk3568/rk3588平台产品在ubuntu 20.04系统上如何更改用户名,本文以ido-evb3588开发板为例,在ubuntu20.04系统上修改用户名industio为usernew。
ido-evb3588开发板是一款基于rk3588平台的产品。该开发板集成了四核cortex-a76和四核cortex-a55 cpu,以及g610 mp4 gpu和6 tops算力的npu。它具有丰富的视频输入输出接口,包括(hdmi-tx/hdmi-rx/edp1.3/mipi-dsi/mipi-csi)。同时还支持高速通信接口,包括(enthernet/pcie3.0/usb3.0/tf卡)。此外,ido-evb3588还提供了工业互联接口,包括(rs485/rs232/uart)。
产品特点
搭载rk3588高性能soc,集成了四核cortex-a76和四核cortex-a55 cpu,主频高达2.4g;
6tops ai算力,三核架构,支持int4/int8/int16/fp16/bf16/tf32;
支持h.265/h.264/av1/vp9/avs2视频解码, 最高8k60fps;
支持 h.264/h.265视频编码, 最高8k30fps;
支持hdmi2.1输出,最高8k@60hz;
支持hdmi2.0 输入, 最高4k60fps;
支持多摄像头输入;
双通道lvds,支持到1080p@60hz 大屏幕 ;
多屏异显;
两路独立的千兆以太网口,支持wan口+lan口 双ip ;
5g/4g/wifi/蓝牙无线通信;
板载4路usb3.0,2路全功能type-c;
支持android 12/debian10/ubuntu20 /buildroot  /麒麟os /openhamoney;
一.更改用户名称
1.修改前需要以root用户登录:ubuntu 20.04.5 lts industio ttyfiq0
industio login: root
password:
welcome to ubuntu 20.04.5 lts (gnu/linux 5.10.110 aarch64)
* documentation: https://help.ubuntu.com
root@industio:~#
2.开始修改用户名:
root@industio:~# usermod -l usernew industio
root@industio:~# groupmod -n usernew industio
root@industio:~# usermod -d /home/usernew -m usernew
3.修改完成后即可使用新用户名登录(登录密码还是之前用户industio的密码:industio):
root@industio:~# exit
logout
ubuntu 20.04.5 lts industio ttyfiq0
industio login: usernew
password:
welcome to ubuntu 20.04.5 lts (gnu/linux 5.10.110 aarch64)
* documentation: https://help.ubuntu.com
 * management:     https://landscape.canonical.com
 * support:        https://ubuntu.com/advantage
this system has been minimized by removing packages and content that are
not required on a system that users do not log into.
to restore this content, you can run the 'unminimize' command.
* introducing expanded security maintenance for applications.
   receive updates to over 25,000 software packages with your
   ubuntu pro subscription. free for personal use.
https://ubuntu.com/pro
expanded security maintenance for applications is not enabled.
0 updates can be applied immediately.
enable esm apps to receive additional future security updates.
see https://ubuntu.com/esm or run: sudo pro status
the list of available updates is more than a week old.
to check for new updates run: sudo apt update
failed to connect to https://changelogs.ubuntu.com/meta-release-lts. check your internet connection or proxy settings
last login: mon jul 3 10:42:41 cst 2023 on ttyfiq0
usernew@industio:~$
二.添加sudo权限
1.以root用户登录,修改/etc/sudoers配置文件,添加usernew用户名
root@industio:~# chmod u+w /etc/sudoers
root@industio:~# vi /etc/sudoers
...
# user privilege specification
root all=(all:all) all
usernew all=(all:all) all
...
root@industio:~# chmod u-w /etc/sudoers
2.退出root登录,使用usernew用户登录测试sudo权限
root@industio:~# exit
logout
ubuntu 20.04.5 lts industio ttyfiq0
industio login: usernew
password:
welcome to ubuntu 20.04.5 lts (gnu/linux 5.10.110 aarch64)
...
usernew@industio:~$ sudo apt-get update
[sudo] password for usernew:
reading package lists... done
...
三.修改hosts和hostname
1.修改hosts:
usernew@industio:~$ sudo vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 usernew
2.修改hostname:
usernew@industio:~$ sudo vi /etc/hostname
usernew
3.重启设备,登录提示信息变为usernew login,且登录成功后命令行前缀变为usernew@usernew:~$:
usernew login: usernew
password:
welcome to ubuntu 20.04.5 lts (gnu/linux 5.10.110 aarch64)
...
usernew@usernew:~$ ls
desktop documents downloads music pictures public templates videos
四.修改用户密码
usernew用户登录,通过passwd命令修改密码:
usernew@usernew:~$ passwd usernew
changing password for usernew.
current password:
new password:
retype new password:
passwd: password updated successfully
五.修改默认桌面登陆用户
1.更改用户名后需同步修改默认桌面登录用户,否则开机无法进入桌面
usernew@usernew:~$ sudo vi /etc/gdm3/custom.conf
...
automaticloginenable=true
automaticlogin=usernew
...
2.修改后重启设备,即可正常进入桌面
至此,在ubuntu20.04上更改用户名完成!

破产清算、出售工厂,这两家知名企业怎么了?
华为一款5G双模手机即将上市我国5G建设正式进入民用商用化阶段
仙知常见FAQ集(十二)
华为云大数据BI解决方案赋能地产行业数字化运营
简述低功耗FPGA设计技术
Ubuntu 20.04如何更改用户名
中央空调的分类有哪些
超颖电子上交所主板IPO申请获受理
污水泵站控制系统的PLC和变频器如何数据采集到云平台上
WT2605-24SS蓝牙语音芯片在按摩椅的应用
美光 DDR5 为第四代英特尔® 至强® 可扩展处理器家族带来更强可靠性
DRAM价格持续下跌 三星电子和SK海力士运营惨淡
解读ChatGPT背后的研究力量:90后成主力军
MOS 管为什么要并联个二极管?
以闪存为动力的存储云一个基于SSD的存储阵列专家
Verizon宣布将为微软和诺基亚提供私有5G网络,帮助降低成本
身为一个局外人该如何打入硅谷?
300PPI或更高像素密度全球液晶面板全球出货量预测
AM OLED的几大优点
自动开箱机的特点及技术参数