在root用户下:
1,/home下不要存在与普通用户名重名的文件夹
2,执行useradd username[普通用户名]
3,在/home文件夹下会创建一个普通用户名的文件夹
4,在vim /etc/sudoers中添加(红色)后,保存
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
username ALL=(ALL) ALL
# Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
username ALL=(ALL) NOPASSWD: ALL
5,切换用户,su username
切换后所在位置是/root目录下,所以执行指令会被拒绝,cd到其它目录即可,cd /home/username
Git 配置SSH秘钥
普通用户下(root用户下如果允许的话):
1, 执行ssh-keygen -t rsa -C "邮箱地址",一路enter
2,会在/home/username下生成.ssh文件
3,将.ssh文件夹下的id_rsa.pub拷贝至git项目下的ssh keys处,即可