Ubuntu Server 启用 root 账户

在安装 Ubuntu Server 时无法启用 root 账户,只能创建一个非 root 账户。
在安装后如何启用 root 账户?

#重设root账户密码
sudo -i passwd root

#用root账户登录
su - root

#安装ssh服务
apt install ssh
systemctl enable ssh

#修改sshd配置,允许root用户用密码登录
nano /etc/ssh/sshd_config.d/sshd.conf

#允许root用户登录
PermitRootLogin yes
#允许使用密码登录
PasswordAuthentication yes

#可选,删除装系统时配置的用户及文件
deluser --remove-home <username#改中国时区
timedatectl set-timezone Asia/Shanghai

重启 ssh 服务生效

阅读全文

Visual Studio 生成文件头注释

有两种方案可以实现此功能

方案一

为项目或解决方案添加 .editorconfig 文件, 修改或新增以下内容。

在任意 .cs… 阅读全文