站点更新:2018-11-02 10:42:27
This commit is contained in:
parent
d8f9419e23
commit
28edd2bdf9
17
Vagrantfile
vendored
17
Vagrantfile
vendored
@ -49,14 +49,15 @@ Vagrant.configure("2") do |config|
|
|||||||
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant", "/vagrant"
|
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant", "/vagrant"
|
||||||
|
|
||||||
# 开机运行命令
|
# 开机运行命令
|
||||||
# cfg.vm.provision "shell", run: "always", inline: <<-SHELL
|
cfg.vm.provision "shell", run: "always", inline: <<-SHELL
|
||||||
# echo -e "\033[1;33mInit cmd...\033[0m"
|
echo -e "\033[1;33mConfig ssh...\033[0m"
|
||||||
# echo -e "\033[1;33mConfig ssh...\033[0m"
|
mkdir -p ~/.ssh && cat /share/config/authorized.key >> ~/.ssh/authorized_keys
|
||||||
# mkdir -p ~/.ssh && cat /vagrant/config/authorized.key >> ~/.ssh/authorized_keys
|
sed -i 's/^#RSAAuthentication.*/RSAAuthentication\ yes/g' /etc/ssh/sshd_config
|
||||||
# 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/^#PubkeyAuthentication.*/PubkeyAuthentication\ yes/g' /etc/ssh/sshd_config
|
sed -i 's/^PasswordAuthentication.*/PasswordAuthentication\ 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"
|
||||||
# SHELL
|
cp /share/config/resolv.conf /etc/
|
||||||
|
SHELL
|
||||||
|
|
||||||
# 自定义初始化执行脚本
|
# 自定义初始化执行脚本
|
||||||
# cfg.vm.provision "shell", path: "config/init.sh"
|
# cfg.vm.provision "shell", path: "config/init.sh"
|
||||||
|
@ -35,6 +35,9 @@ 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/^#PubkeyAuthentication.*/PubkeyAuthentication\ yes/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/^PasswordAuthentication.*/PasswordAuthentication\ 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 /vagrant/config/resolv.conf /etc/
|
||||||
|
|
||||||
# echo -e "\033[1;33mUpdating kernel...\033[0m"
|
# echo -e "\033[1;33mUpdating kernel...\033[0m"
|
||||||
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
|
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
|
||||||
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
|
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
|
||||||
|
4
config/resolv.conf
Normal file
4
config/resolv.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Generated by NetworkManager
|
||||||
|
|
||||||
|
nameserver 114.114.114.114
|
||||||
|
nameserver 8.8.8.8
|
Loading…
Reference in New Issue
Block a user