【技术分享】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上更改用户名完成!
本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/641ccb23a8.html
