SSH onto Vagrant Box With Different Username

后端 未结 4 1242
梦如初夏
梦如初夏 2020-12-22 22:46

Rather than ssh-ing onto my Vagrant virtual machine with a \"vagrant\" user-name and password, I\'d like to use kevin/kevin.

I modified my Vagrantfile t

4条回答
  •  佛祖请我去吃肉
    2020-12-22 23:23

    A bit of a hack, but you could add the line sudo su - kevin to your .bash_profile file and add kevin to the sudoers file with no password.

    This will change the current user to kevin when logging in as the vagrant user from the command line.

    The advantage of this approach is that NAT does not need to be enabled.

提交回复
热议问题