某些情况下,ubuntu 使用useradd 新用户名,在home 文件夹下面看不到新创建的用户文件夹,例如:
root@worker:/home/kuku#useraddspark root@worker:/home/kuku#passwdspark EnternewUNIXpassword: RetypenewUNIXpassword: passwd:passwordupdatedsuccessfully root@worker:/home/kuku#cd.. root@worker:/home#ls kuku root@worker:/home#
发现找不到,spark的文件夹,因此将采用下面方式重新建立
root@worker:/home#userdelspark root@worker:/home#useradd-r-m-s/bin/bashspark root@worker:/home#passwdspark EnternewUNIXpassword: RetypenewUNIXpassword: passwd:passwordupdatedsuccessfully root@worker:/home#ls kukuspark root@worker:/home#
root@worker:/home#chmod+w/etc/sudoers root@worker:/home#vim/etc/sudoers
保存即可!
root@worker:/home#userdel-rspark userdel:sparkmailspool(/var/mail/spark)notfound root@worker:/home#ls kuku root@worker:/home#
即可