OMV新建用户遇到的一些问题,有关OMV的相关介绍,请查看:

https://draapho.github.io/2021/03/31/2109-nuc-omv/

新建用户

  • 方法一:使用dash控制面板

  • 方法二;使用useradd命令

    1
    useradd -s /bin/bash pub

bash和profile相关知识

拷贝root用户配置文件

  • root ssh登录拷贝

    1
    2
    3
    4
    cp /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 星期六