问题描述
ubuntu新建账户默认没有家目录相关的默认文件/etc/skel/*
useradd -m xxx
问题解决
/etc/skel 用户的家目录的.xxx文件从这个目录下copy
root@ingcreations:/etc/skel# cd /etc/skel
root@ingcreations:/etc/skel# ls -aF /etc/skel/ |egrep -v "/$" |xargs -i cp {} /home/vbox/
root@ingcreations:/etc/skel# ll -al
drwxr-xr-x 2 root root 4096 Feb 4 2018 ./
drwxr-xr-x 126 root root 12288 Mar 12 09:32 ../
-rw-r--r-- 1 root root 220 Sep 1 2015 .bash_logout
-rw-r--r-- 1 root root 3771 Sep 1 2015 .bashrc
-rw-r--r-- 1 root root 655 May 16 2017 .profile
root@ingcreations:/etc/skel# chown -R vbox: /home/vbox/
root@ingcreations:/etc/skel# su - vbox
vbox@ingcreations:~$ pwd
/home/vbox
vbox@ingcreations:~$