站点更新:2018-11-02 12:42:29
This commit is contained in:
parent
28edd2bdf9
commit
03ac98fc27
8
Vagrantfile
vendored
8
Vagrantfile
vendored
@ -45,18 +45,18 @@ Vagrant.configure("2") do |config|
|
||||
# do NOT check the correct additions version when booting this machine(插件安装:vagrant plugin install vagrant-vbguest)
|
||||
cfg.vbguest.auto_update = false
|
||||
|
||||
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant/vm_share", "/share"
|
||||
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant", "/vagrant"
|
||||
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant/vm_share", "/root/"
|
||||
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant", "/vagrant", disabled: true
|
||||
|
||||
# 开机运行命令
|
||||
cfg.vm.provision "shell", run: "always", inline: <<-SHELL
|
||||
echo -e "\033[1;33mConfig ssh...\033[0m"
|
||||
mkdir -p ~/.ssh && cat /share/config/authorized.key >> ~/.ssh/authorized_keys
|
||||
mkdir -p ~/.ssh && cat /root/config/authorized.key >> ~/.ssh/authorized_keys
|
||||
sed -i 's/^#RSAAuthentication.*/RSAAuthentication\ yes/g' /etc/ssh/sshd_config
|
||||
sed -i 's/^#PubkeyAuthentication.*/PubkeyAuthentication\ yes/g' /etc/ssh/sshd_config
|
||||
sed -i 's/^PasswordAuthentication.*/PasswordAuthentication\ yes/g' /etc/ssh/sshd_config
|
||||
echo -e "\033[1;33mConfig dns...\033[0m"
|
||||
cp /share/config/resolv.conf /etc/
|
||||
cp /root/config/resolv.conf /etc/
|
||||
SHELL
|
||||
|
||||
# 自定义初始化执行脚本
|
||||
|
Loading…
Reference in New Issue
Block a user