質問編集履歴
2
コードがダブっていたので修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -123,112 +123,4 @@
|
|
123
123
|
default: /home/vagrant => /Users/hogeTaro/work
|
124
124
|
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
|
125
125
|
==> default: flag to force provisioning. Provisioners marked to run always will still run.
|
126
|
-
```
|
127
|
-
```Vagrantfile
|
128
|
-
# -*- mode: ruby -*-
|
129
|
-
# vi: set ft=ruby :
|
130
|
-
|
131
|
-
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
132
|
-
# configures the configuration version (we support older styles for
|
133
|
-
# backwards compatibility).
|
134
|
-
# you're doing.
|
135
|
-
Vagrant.configure(2) do |config|
|
136
|
-
# The most common configuration options are documented and commented below.
|
137
|
-
# For a complete reference, please see the online documentation at
|
138
|
-
# https://docs.vagrantup.com.
|
139
|
-
|
140
|
-
# Every Vagrant development environment requires a box. You can search for
|
141
|
-
# boxes at https://atlas.hashicorp.com/search.
|
142
|
-
config.vm.box = "debian/jessie64"
|
143
|
-
|
144
|
-
# Disable automatic box update checking. If you disable this, then
|
145
|
-
# boxes will only be checked for updates when the user runs
|
146
|
-
# `vagrant box outdated`. This is not recommended.
|
147
|
-
# config.vm.box_check_update = false
|
148
|
-
|
149
|
-
# Create a forwarded port mapping which allows access to a specific port
|
150
|
-
# within the machine from a port on the host machine. In the example below,
|
151
|
-
# accessing "localhost:8080" will access port 80 on the guest machine.
|
152
|
-
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
153
|
-
|
154
|
-
# Create a private network, which allows host-only access to the machine
|
155
|
-
# using a specific IP.
|
156
|
-
config.vm.network "private_network", ip: "192.168.33.10"
|
157
|
-
|
158
|
-
# Create a public network, which generally matched to bridged network.
|
159
|
-
# Bridged networks make the machine appear as another physical device on
|
160
|
-
# your network.
|
161
|
-
# config.vm.network "public_network"
|
162
|
-
|
163
|
-
# Share an additional folder to the guest VM. The first argument is
|
164
|
-
# the path on the host to the actual folder. The second argument is
|
165
|
-
# the path on the guest to mount the folder. And the optional third
|
166
|
-
# argument is a set of non-required options.
|
167
|
-
config.vm.synced_folder "./", "/home/vagrant/"
|
168
|
-
|
169
|
-
# Provider-specific configuration so you can fine-tune various
|
170
|
-
# backing providers for Vagrant. These expose provider-specific options.
|
171
|
-
# Example for VirtualBox:
|
172
|
-
#
|
173
|
-
# config.vm.provider "virtualbox" do |vb|
|
174
|
-
# # Display the VirtualBox GUI when booting the machine
|
175
|
-
# vb.gui = true
|
176
|
-
#
|
177
|
-
# # Customize the amount of memory on the VM:
|
178
|
-
# vb.memory = "1024"
|
179
|
-
# end
|
180
|
-
#
|
181
|
-
# View the documentation for the provider you are using for more
|
182
|
-
# information on available options.
|
183
|
-
|
184
|
-
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
185
|
-
# such as FTP and Heroku are also available. See the documentation at
|
186
|
-
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
187
|
-
# config.push.define "atlas" do |push|
|
188
|
-
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
189
|
-
# end
|
190
|
-
|
191
|
-
# Enable provisioning with a shell script. Additional provisioners such as
|
192
|
-
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
193
|
-
# documentation for more information about their specific syntax and use.
|
194
|
-
# config.vm.provision "shell", inline: <<-SHELL
|
195
|
-
# sudo apt-get update
|
196
|
-
# sudo apt-get install -y apache2
|
197
|
-
# SHELL
|
198
|
-
end
|
199
|
-
```
|
200
|
-
|
201
|
-
```shell
|
202
|
-
$ vagrant --version
|
203
|
-
Vagrant 1.8.1
|
204
|
-
```
|
205
|
-
|
206
|
-
```shell
|
207
|
-
$ vagrant up
|
208
|
-
Bringing machine 'default' up with 'virtualbox' provider...
|
209
|
-
==> default: Checking if box 'debian/jessie64' is up to date...
|
210
|
-
==> default: A newer version of the box 'debian/jessie64' is available! You currently
|
211
|
-
==> default: have version '8.4.0'. The latest is version '8.5.0'. Run
|
212
|
-
==> default: `vagrant box update` to update.
|
213
|
-
==> default: Clearing any previously set forwarded ports...
|
214
|
-
==> default: Clearing any previously set network interfaces...
|
215
|
-
==> default: Preparing network interfaces based on configuration...
|
216
|
-
default: Adapter 1: nat
|
217
|
-
default: Adapter 2: hostonly
|
218
|
-
==> default: Forwarding ports...
|
219
|
-
default: 22 (guest) => 2222 (host) (adapter 1)
|
220
|
-
==> default: Booting VM...
|
221
|
-
==> default: Waiting for machine to boot. This may take a few minutes...
|
222
|
-
default: SSH address: 127.0.0.1:2222
|
223
|
-
default: SSH username: vagrant
|
224
|
-
default: SSH auth method: private key
|
225
|
-
==> default: Machine booted and ready!
|
226
|
-
GuestAdditions 5.0.16 running --- OK.
|
227
|
-
==> default: Checking for guest additions in VM...
|
228
|
-
==> default: Configuring and enabling network interfaces...
|
229
|
-
==> default: Rsyncing folder: /Users/hogeTaro/work/ => /vagrant
|
230
|
-
==> default: Mounting shared folders...
|
231
|
-
default: /home/vagrant => /Users/hogeTaro/work
|
232
|
-
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
|
233
|
-
==> default: flag to force provisioning. Provisioners marked to run always will still run.
|
234
126
|
```
|
1
コードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
vagrant upのあとにvagrant sshでゲストPCにログインできると思うのですが、その際に毎回パスワードを聞かれます.
|
2
2
|
|
3
3
|
```Shell
|
4
4
|
work hogeTaro$ vagrant ssh-config
|
@@ -13,7 +13,222 @@
|
|
13
13
|
IdentitiesOnly yes
|
14
14
|
LogLevel FATAL
|
15
15
|
```
|
16
|
+
|
16
17
|
とssh-configを見る限りはIdentityFileで秘密鍵を指定しているのですが、これだけではダメなのでしょうか?例えばVagrantは~/.ssh/configも見に行っているとか、そういうことなんでしょうか?(sshに関する知識が中途半端ですいません)
|
17
18
|
|
18
19
|
vagarnt sshでパスワードを入力ぜずにログインできる方法を教えていただけますと幸いです。
|
19
|
-
よろしくお願い致します。
|
20
|
+
よろしくお願い致します。
|
21
|
+
|
22
|
+
Vagrant 1.8.1
|
23
|
+
|
24
|
+
```Vagrantfile
|
25
|
+
# -*- mode: ruby -*-
|
26
|
+
# vi: set ft=ruby :
|
27
|
+
|
28
|
+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
29
|
+
# configures the configuration version (we support older styles for
|
30
|
+
# backwards compatibility).
|
31
|
+
# you're doing.
|
32
|
+
Vagrant.configure(2) do |config|
|
33
|
+
# The most common configuration options are documented and commented below.
|
34
|
+
# For a complete reference, please see the online documentation at
|
35
|
+
# https://docs.vagrantup.com.
|
36
|
+
|
37
|
+
# Every Vagrant development environment requires a box. You can search for
|
38
|
+
# boxes at https://atlas.hashicorp.com/search.
|
39
|
+
config.vm.box = "debian/jessie64"
|
40
|
+
|
41
|
+
# Disable automatic box update checking. If you disable this, then
|
42
|
+
# boxes will only be checked for updates when the user runs
|
43
|
+
# `vagrant box outdated`. This is not recommended.
|
44
|
+
# config.vm.box_check_update = false
|
45
|
+
|
46
|
+
# Create a forwarded port mapping which allows access to a specific port
|
47
|
+
# within the machine from a port on the host machine. In the example below,
|
48
|
+
# accessing "localhost:8080" will access port 80 on the guest machine.
|
49
|
+
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
50
|
+
|
51
|
+
# Create a private network, which allows host-only access to the machine
|
52
|
+
# using a specific IP.
|
53
|
+
config.vm.network "private_network", ip: "192.168.33.10"
|
54
|
+
|
55
|
+
# Create a public network, which generally matched to bridged network.
|
56
|
+
# Bridged networks make the machine appear as another physical device on
|
57
|
+
# your network.
|
58
|
+
# config.vm.network "public_network"
|
59
|
+
|
60
|
+
# Share an additional folder to the guest VM. The first argument is
|
61
|
+
# the path on the host to the actual folder. The second argument is
|
62
|
+
# the path on the guest to mount the folder. And the optional third
|
63
|
+
# argument is a set of non-required options.
|
64
|
+
config.vm.synced_folder "./", "/home/vagrant/"
|
65
|
+
|
66
|
+
# Provider-specific configuration so you can fine-tune various
|
67
|
+
# backing providers for Vagrant. These expose provider-specific options.
|
68
|
+
# Example for VirtualBox:
|
69
|
+
#
|
70
|
+
# config.vm.provider "virtualbox" do |vb|
|
71
|
+
# # Display the VirtualBox GUI when booting the machine
|
72
|
+
# vb.gui = true
|
73
|
+
#
|
74
|
+
# # Customize the amount of memory on the VM:
|
75
|
+
# vb.memory = "1024"
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# View the documentation for the provider you are using for more
|
79
|
+
# information on available options.
|
80
|
+
|
81
|
+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
82
|
+
# such as FTP and Heroku are also available. See the documentation at
|
83
|
+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
84
|
+
# config.push.define "atlas" do |push|
|
85
|
+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
86
|
+
# end
|
87
|
+
|
88
|
+
# Enable provisioning with a shell script. Additional provisioners such as
|
89
|
+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
90
|
+
# documentation for more information about their specific syntax and use.
|
91
|
+
# config.vm.provision "shell", inline: <<-SHELL
|
92
|
+
# sudo apt-get update
|
93
|
+
# sudo apt-get install -y apache2
|
94
|
+
# SHELL
|
95
|
+
end
|
96
|
+
```
|
97
|
+
|
98
|
+
```shell
|
99
|
+
$ vagrant up
|
100
|
+
Bringing machine 'default' up with 'virtualbox' provider...
|
101
|
+
==> default: Checking if box 'debian/jessie64' is up to date...
|
102
|
+
==> default: A newer version of the box 'debian/jessie64' is available! You currently
|
103
|
+
==> default: have version '8.4.0'. The latest is version '8.5.0'. Run
|
104
|
+
==> default: `vagrant box update` to update.
|
105
|
+
==> default: Clearing any previously set forwarded ports...
|
106
|
+
==> default: Clearing any previously set network interfaces...
|
107
|
+
==> default: Preparing network interfaces based on configuration...
|
108
|
+
default: Adapter 1: nat
|
109
|
+
default: Adapter 2: hostonly
|
110
|
+
==> default: Forwarding ports...
|
111
|
+
default: 22 (guest) => 2222 (host) (adapter 1)
|
112
|
+
==> default: Booting VM...
|
113
|
+
==> default: Waiting for machine to boot. This may take a few minutes...
|
114
|
+
default: SSH address: 127.0.0.1:2222
|
115
|
+
default: SSH username: vagrant
|
116
|
+
default: SSH auth method: private key
|
117
|
+
==> default: Machine booted and ready!
|
118
|
+
GuestAdditions 5.0.16 running --- OK.
|
119
|
+
==> default: Checking for guest additions in VM...
|
120
|
+
==> default: Configuring and enabling network interfaces...
|
121
|
+
==> default: Rsyncing folder: /Users/hogeTaro/work/ => /vagrant
|
122
|
+
==> default: Mounting shared folders...
|
123
|
+
default: /home/vagrant => /Users/hogeTaro/work
|
124
|
+
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
|
125
|
+
==> default: flag to force provisioning. Provisioners marked to run always will still run.
|
126
|
+
```
|
127
|
+
```Vagrantfile
|
128
|
+
# -*- mode: ruby -*-
|
129
|
+
# vi: set ft=ruby :
|
130
|
+
|
131
|
+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
132
|
+
# configures the configuration version (we support older styles for
|
133
|
+
# backwards compatibility).
|
134
|
+
# you're doing.
|
135
|
+
Vagrant.configure(2) do |config|
|
136
|
+
# The most common configuration options are documented and commented below.
|
137
|
+
# For a complete reference, please see the online documentation at
|
138
|
+
# https://docs.vagrantup.com.
|
139
|
+
|
140
|
+
# Every Vagrant development environment requires a box. You can search for
|
141
|
+
# boxes at https://atlas.hashicorp.com/search.
|
142
|
+
config.vm.box = "debian/jessie64"
|
143
|
+
|
144
|
+
# Disable automatic box update checking. If you disable this, then
|
145
|
+
# boxes will only be checked for updates when the user runs
|
146
|
+
# `vagrant box outdated`. This is not recommended.
|
147
|
+
# config.vm.box_check_update = false
|
148
|
+
|
149
|
+
# Create a forwarded port mapping which allows access to a specific port
|
150
|
+
# within the machine from a port on the host machine. In the example below,
|
151
|
+
# accessing "localhost:8080" will access port 80 on the guest machine.
|
152
|
+
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
153
|
+
|
154
|
+
# Create a private network, which allows host-only access to the machine
|
155
|
+
# using a specific IP.
|
156
|
+
config.vm.network "private_network", ip: "192.168.33.10"
|
157
|
+
|
158
|
+
# Create a public network, which generally matched to bridged network.
|
159
|
+
# Bridged networks make the machine appear as another physical device on
|
160
|
+
# your network.
|
161
|
+
# config.vm.network "public_network"
|
162
|
+
|
163
|
+
# Share an additional folder to the guest VM. The first argument is
|
164
|
+
# the path on the host to the actual folder. The second argument is
|
165
|
+
# the path on the guest to mount the folder. And the optional third
|
166
|
+
# argument is a set of non-required options.
|
167
|
+
config.vm.synced_folder "./", "/home/vagrant/"
|
168
|
+
|
169
|
+
# Provider-specific configuration so you can fine-tune various
|
170
|
+
# backing providers for Vagrant. These expose provider-specific options.
|
171
|
+
# Example for VirtualBox:
|
172
|
+
#
|
173
|
+
# config.vm.provider "virtualbox" do |vb|
|
174
|
+
# # Display the VirtualBox GUI when booting the machine
|
175
|
+
# vb.gui = true
|
176
|
+
#
|
177
|
+
# # Customize the amount of memory on the VM:
|
178
|
+
# vb.memory = "1024"
|
179
|
+
# end
|
180
|
+
#
|
181
|
+
# View the documentation for the provider you are using for more
|
182
|
+
# information on available options.
|
183
|
+
|
184
|
+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
185
|
+
# such as FTP and Heroku are also available. See the documentation at
|
186
|
+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
187
|
+
# config.push.define "atlas" do |push|
|
188
|
+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
189
|
+
# end
|
190
|
+
|
191
|
+
# Enable provisioning with a shell script. Additional provisioners such as
|
192
|
+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
193
|
+
# documentation for more information about their specific syntax and use.
|
194
|
+
# config.vm.provision "shell", inline: <<-SHELL
|
195
|
+
# sudo apt-get update
|
196
|
+
# sudo apt-get install -y apache2
|
197
|
+
# SHELL
|
198
|
+
end
|
199
|
+
```
|
200
|
+
|
201
|
+
```shell
|
202
|
+
$ vagrant --version
|
203
|
+
Vagrant 1.8.1
|
204
|
+
```
|
205
|
+
|
206
|
+
```shell
|
207
|
+
$ vagrant up
|
208
|
+
Bringing machine 'default' up with 'virtualbox' provider...
|
209
|
+
==> default: Checking if box 'debian/jessie64' is up to date...
|
210
|
+
==> default: A newer version of the box 'debian/jessie64' is available! You currently
|
211
|
+
==> default: have version '8.4.0'. The latest is version '8.5.0'. Run
|
212
|
+
==> default: `vagrant box update` to update.
|
213
|
+
==> default: Clearing any previously set forwarded ports...
|
214
|
+
==> default: Clearing any previously set network interfaces...
|
215
|
+
==> default: Preparing network interfaces based on configuration...
|
216
|
+
default: Adapter 1: nat
|
217
|
+
default: Adapter 2: hostonly
|
218
|
+
==> default: Forwarding ports...
|
219
|
+
default: 22 (guest) => 2222 (host) (adapter 1)
|
220
|
+
==> default: Booting VM...
|
221
|
+
==> default: Waiting for machine to boot. This may take a few minutes...
|
222
|
+
default: SSH address: 127.0.0.1:2222
|
223
|
+
default: SSH username: vagrant
|
224
|
+
default: SSH auth method: private key
|
225
|
+
==> default: Machine booted and ready!
|
226
|
+
GuestAdditions 5.0.16 running --- OK.
|
227
|
+
==> default: Checking for guest additions in VM...
|
228
|
+
==> default: Configuring and enabling network interfaces...
|
229
|
+
==> default: Rsyncing folder: /Users/hogeTaro/work/ => /vagrant
|
230
|
+
==> default: Mounting shared folders...
|
231
|
+
default: /home/vagrant => /Users/hogeTaro/work
|
232
|
+
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
|
233
|
+
==> default: flag to force provisioning. Provisioners marked to run always will still run.
|
234
|
+
```
|