omv新建用户ssh登录问题
OMV新建用户遇到的一些问题,有关OMV的相关介绍,请查看:
https://draapho.github.io/2021/03/31/2109-nuc-omv/
新建用户
方法一:使用dash控制面板
方法二;使用useradd命令
1
useradd -s /bin/bash pub
bash和profile相关知识
引用地址:
login shell 和 no login shell
bash和profile的区别
拷贝root用户配置文件
root ssh登录拷贝
1
2
3
4cp /root/.bashrc /home/xxx/
cp /root/.profile /home/xxx/
chown xxx .bashrc .profile
chgrp xxx .bashrc .profile注意:
.profile
文件中配置如下1
2
3
4
5
6
7~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n || true这个脚本中的
$BASH
判断用户使用的shell是否是bash shell,所以如果创建时没有选对,可以通过/etc/passwd
修改
关于新建用户不能shell登录问题
原因:sshd配置文件中对可登录的user group做了限定
/etc/ssh/sshd_config中:解决方法:修改用户所在组,将用户添加到ssh组; 或修改sshd_config,允许新user group;
2020-09-12 23:46:35 星期六