我想将ssh密钥移入无业游民并将其放进去~/.ssh
,最简单的方法是什么?我的Vagrant文件中包含以下内容:
config.vm.synced_folder "conf.d", "/svr/conf.d"
config.vm.provision :shell,
:inline => "ls -l /svr/conf.d/.ssh"
总数4 -rw-r--r-- 1个无业游民无业游民1670 Mar 26 08:19 id_rsa.mediapop
config.vm.provision :shell,
:inline => "cp /svr/conf.d/.ssh/id_rsa.mediapop /home/ubuntu/.ssh/id_rsa"
config.vm.provision :shell,
:inline => "ls -l /home/ubuntu/.ssh"
总数4 -rw ------- 1 ubuntu ubuntu 0 Mar 22 08:56authorized_keys -rw-r--r-- 1 root root 1670 Mar 26 08:59 id_rsa
但是当我这样做时,vagrant ssh -c "ls -l ~/.ssh"
我得到:
$ vagrant ssh -c "ls -l ~/.ssh"
total 4
-rw-r--r-- 1 vagrant vagrant 409 Mar 20 04:47 authorized_keys
所以流浪汉正在覆盖我的.ssh
目录。