teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

vagrant destroy

2020/02/06 12:52

投稿

Katsuma-F
Katsuma-F

スコア6

title CHANGED
File without changes
body CHANGED
@@ -137,4 +137,7 @@
137
137
  debug1: identity file .vagrant/machines/default/virtualbox/private_key-cert type -1
138
138
  debug1: Local version string SSH-2.0-OpenSSH_7.9
139
139
  ssh_exchange_identification: read: Connection reset by peer
140
- ```
140
+ ```
141
+ ---
142
+
143
+ 最終的には```vagrant destroy```をして、環境を再構築することになりました。

4

-iオプションを付けた場合

2020/02/06 12:52

投稿

Katsuma-F
Katsuma-F

スコア6

title CHANGED
File without changes
body CHANGED
@@ -119,4 +119,22 @@
119
119
  debug1: identity file /Users/ユ/.ssh/id_xmss-cert type -1
120
120
  debug1: Local version string SSH-2.0-OpenSSH_7.9
121
121
  ssh_exchange_identification: read: Connection reset by peer
122
+ ```
123
+ -iオプションを付けた場合
124
+ ```
125
+ MacBook-Pro:MyCentOS ユーザー名$ ssh -vvv vagrant@localhost -p 2222 -i .vagrant/machines/default/virtualbox/private_key
126
+ OpenSSH_7.9p1, LibreSSL 2.7.3
127
+ debug1: Reading configuration data /Users/ユーザー名/.ssh/config
128
+ debug1: Reading configuration data /etc/ssh/ssh_config
129
+ debug1: /etc/ssh/ssh_config line 48: Applying options for *
130
+ debug2: resolving "localhost" port 2222
131
+ debug2: ssh_connect_direct
132
+ debug1: Connecting to localhost [::1] port 2222.
133
+ debug1: connect to address ::1 port 2222: Connection refused
134
+ debug1: Connecting to localhost [127.0.0.1] port 2222.
135
+ debug1: Connection established.
136
+ debug1: identity file .vagrant/machines/default/virtualbox/private_key type -1
137
+ debug1: identity file .vagrant/machines/default/virtualbox/private_key-cert type -1
138
+ debug1: Local version string SSH-2.0-OpenSSH_7.9
139
+ ssh_exchange_identification: read: Connection reset by peer
122
140
  ```

3

デバッグのコマンドによる表示内容

2020/02/06 03:48

投稿

Katsuma-F
Katsuma-F

スコア6

title CHANGED
File without changes
body CHANGED
@@ -89,4 +89,34 @@
89
89
  上記のコマンドは、秘密鍵から作成した公開鍵を具体的にどうすることなのでしょうか?
90
90
 
91
91
  これは、作成したpublic_keyファイルを /Users/ユーザー名/MyVagrant/MyCentOS/.ssh/ に配置&上書きすることなのではないかと下記のQiitaの記事を読んで自分なりに推測していますが、ご指摘のほどよろしくお願い申し上げます。
92
- [VagrantでSSH鍵の設定 - [Authentication failure. Retrying…]の対処策](https://qiita.com/Esfahan/items/e5f707dc6d116c2cc751)
92
+ [VagrantでSSH鍵の設定 - [Authentication failure. Retrying…]の対処策](https://qiita.com/Esfahan/items/e5f707dc6d116c2cc751)
93
+
94
+
95
+ ---
96
+
97
+ ---
98
+ ```
99
+ MacBook-Pro:MyCentOS ユーザー名$ ssh -vvv vagrant@localhost -p 2222 .vagrant/machines/default/virtualbox/private_key
100
+ OpenSSH_7.9p1, LibreSSL 2.7.3
101
+ debug1: Reading configuration data /Users/ユーザー名/.ssh/config
102
+ debug1: Reading configuration data /etc/ssh/ssh_config
103
+ debug1: /etc/ssh/ssh_config line 48: Applying options for *
104
+ debug2: resolving "localhost" port 2222
105
+ debug2: ssh_connect_direct
106
+ debug1: Connecting to localhost [::1] port 2222.
107
+ debug1: connect to address ::1 port 2222: Connection refused
108
+ debug1: Connecting to localhost [127.0.0.1] port 2222.
109
+ debug1: Connection established.
110
+ debug1: identity file /Users/ユーザー名/.ssh/id_rsa type 0
111
+ debug1: identity file /Users/ユ/.ssh/id_rsa-cert type -1
112
+ debug1: identity file /Users/ユ/.ssh/id_dsa type -1
113
+ debug1: identity file /Users/ユ/.ssh/id_dsa-cert type -1
114
+ debug1: identity file /Users/ユ/.ssh/id_ecdsa type -1
115
+ debug1: identity file /Users/ユ/.ssh/id_ecdsa-cert type -1
116
+ debug1: identity file /Users/ユ/.ssh/id_ed25519 type -1
117
+ debug1: identity file /Users/ユ/.ssh/id_ed25519-cert type -1
118
+ debug1: identity file /Users/ユ/.ssh/id_xmss type -1
119
+ debug1: identity file /Users/ユ/.ssh/id_xmss-cert type -1
120
+ debug1: Local version string SSH-2.0-OpenSSH_7.9
121
+ ssh_exchange_identification: read: Connection reset by peer
122
+ ```

2

誤字を修正

2020/02/04 13:27

投稿

Katsuma-F
Katsuma-F

スコア6

title CHANGED
File without changes
body CHANGED
@@ -86,7 +86,7 @@
86
86
  emacs public_key
87
87
  公開鍵をコピー
88
88
  ```
89
- 上記のコマンドは、作成した秘密鍵から作成した公開鍵を具体的にどうすることなのでしょうか?
89
+ 上記のコマンドは、秘密鍵から作成した公開鍵を具体的にどうすることなのでしょうか?
90
90
 
91
91
  これは、作成したpublic_keyファイルを /Users/ユーザー名/MyVagrant/MyCentOS/.ssh/ に配置&上書きすることなのではないかと下記のQiitaの記事を読んで自分なりに推測していますが、ご指摘のほどよろしくお願い申し上げます。
92
92
  [VagrantでSSH鍵の設定 - [Authentication failure. Retrying…]の対処策](https://qiita.com/Esfahan/items/e5f707dc6d116c2cc751)

1

上手くアップできなかったので更新しました。

2020/02/03 13:03

投稿

Katsuma-F
Katsuma-F

スコア6

title CHANGED
File without changes
body CHANGED
@@ -4,6 +4,14 @@
4
4
  フォルダ階層は下記の様になっています。
5
5
  /Users/ユーザー名/MyVagrant/MyCentOS
6
6
  「MyCentOS」というフォルダ上で vagrant コマンドを実行しています。
7
+ ```Vagrant
8
+ MacBook-Pro:.ssh ユーザー名$ pwd
9
+ /Users/ユーザー名/MyVagrant/MyCentOS/.ssh
10
+ MacBook-Pro:.ssh ユーザー名$ ls -la
11
+ total 0
12
+ drwxr-xr-x 2 ユーザー名 staff 64 1 27 19:56 .
13
+ drwxr-xr-x 14 ユーザー名 staff 448 2 3 21:35 ..
14
+ ```
7
15
  #### 環境
8
16
  - macOS Catalina 10.15.3
9
17
  - VirtualBox 5.2.36
@@ -44,6 +52,18 @@
44
52
  If the box appears to be booting properly, you may want to increase
45
53
  the timeout ("config.vm.boot_timeout") value.
46
54
  ```
55
+ vagrant up ができているか確認
56
+ ```Vagrant
57
+ MacBook-Pro:MyCentOS ユーザー名$ vagrant status
58
+ Current machine states:
59
+
60
+ default running (virtualbox)
61
+
62
+ The VM is running. To stop this VM, you can run `vagrant halt` to
63
+ shut it down forcefully, or you can run `vagrant suspend` to simply
64
+ suspend the virtual machine. In either case, to restart it again,
65
+ simply run `vagrant up`.
66
+ ```
47
67
  この直後に vagrant ssh をすると、
48
68
  ```Vagrant
49
69
  MacBook-Pro:MyCentOS ユーザー名$ vagrant ssh
@@ -53,14 +73,14 @@
53
73
  ## 試したこと
54
74
  同じ問題が記載されていると思った下記のHatena Blogを参考に解決しようしています。
55
75
  [vagrant upでprivate keyより先に進まない症状](http://tauplank.hatenablog.com/entry/2016/10/23/153728)
56
- しかし、理解できないことが2つあります。
76
+ しかし、理解できないことが2つあるので教えていただきたいです。
57
77
  記事中の、
58
78
  ```
59
79
  作成した公開鍵を
60
80
  /Users/hoge/MyVagrant
61
81
  に貼り付け
62
82
  ```
63
- とは、直前で作成したpublic_keyというファイルをMyVagrant/ に貼り付けるという作業で間違いないでしょうか?
83
+ とは、直前で作成したpublic_keyというファイルをMyVagrant/ に貼り付けるという作業で間違いないでしょうか?
64
84
 
65
85
  ```
66
86
  emacs public_key
@@ -68,5 +88,5 @@
68
88
  ```
69
89
  上記のコマンドは、作成した秘密鍵から作成した公開鍵を具体的にどうすることなのでしょうか?
70
90
 
71
- また下記のサイトを参考にパブリックキーファイルの中身に先ほど作成した公開鍵ファイルの内容を上書きするとvagrant sshが成功するのでしょう
91
+ これは、作成したpublic_keyファイルを /Users/ユーザー名/MyVagrant/MyCentOS/.ssh/ に配置&上書きするのではないと下記のQiitaの記事を読んで自分なりに推測していますが、ご指摘のほどよろしくお願い申し上げます。
72
92
  [VagrantでSSH鍵の設定 - [Authentication failure. Retrying…]の対処策](https://qiita.com/Esfahan/items/e5f707dc6d116c2cc751)