系统是debian10
默认是采用vagrant登录的

su - root #切换到root

adduser -m odoo #创建用户

usermod -aG sudo odoo #对odoo 设置sudo访问权限

visudo /etc/sudoers.d/odoo #创建配置文件

echo "odoo ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/odoo #配置运行sudo命令无需密码

vi /etc/ssh/sshd_config #配置sshd,并写入如下

AllowUsers odoo vagrant

systemctl restart sshd #重启sshd

Vagrantfile配置
config.ssh.username = "odoo"
config.ssh.password = "odoo"
config.vm.synced_folder "E:/workspace/web/odoo", "/home/odoo",owner:"odoo",group:"odoo",create:true,mount_options:["dmode=775","fmode=664"]
config.vm.synced_folder ".","/vagrant",disabled:true

然后vagrant reload 就行