호스트 OS에서 방랑하는 게스트 OS로 ssh-copy-id를 복사하는 방법

호스트 OS에서 방랑하는 게스트 OS로 ssh-copy-id를 복사하는 방법

나는 방랑 게스트 머신을 만들었습니다. 아래는 Vagrantfile-

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

  config.vm.box = "ubuntu/lunar64"

  config.vm.network "private_network", ip: "192.168.33.10"

   config.vm.provider "virtualbox" do |vb|
     vb.memory = "1024"
   end
end

게스트 컴퓨터에 ping을 수행하면 호스트 컴퓨터에서 제대로 작동합니다.

$ ping -c 3 192.168.33.10
PING 192.168.33.10 (192.168.33.10) 56(84) bytes of data.
64 bytes from 192.168.33.10: icmp_seq=1 ttl=64 time=0.606 ms
64 bytes from 192.168.33.10: icmp_seq=2 ttl=64 time=0.588 ms
64 bytes from 192.168.33.10: icmp_seq=3 ttl=64 time=0.301 ms

--- 192.168.33.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2031ms
rtt min/avg/max/mdev = 0.301/0.498/0.606/0.139 ms

ssh-copy-id이제 호스트 컴퓨터에서 게스트 OS로 전환 하고 싶습니다 . 나는 command 를 사용하여 vagrant에 ssh를 연결할 수 있다는 것을 알고 있습니다 vagrant ssh. 하지만 ssh 192.168.33.10.

하지만 오류가 발생합니다.

$ ssh-copy-id 192.168.33.10
The authenticity of host '192.168.33.10 (192.168.33.10)' can't be established.
ED25519 key fingerprint is SHA256:Ultxy8OXuoD+ftDsJvy19fYbJNBS/znIukm+39GNdLE.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 2 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]: Permission denied (publickey).

vagrant를 사용하여 ansible 플레이북을 배우고 있기 때문에 이 방법을 사용하고 싶습니다. 이 문제를 어떻게 해결할 수 있나요?

관련 정보