AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1479282
Accepted
nelaaro
nelaaro
Asked: 2019-09-06 06:37:58 +0800 CST2019-09-06 06:37:58 +0800 CST 2019-09-06 06:37:58 +0800 CST

ssh 到一个新的 'vagrant up' 直到我第一次运行 vagrant ssh 之后才起作用

  • 772

当我刚开始一个新的流浪者evn。在我执行vagrant ssh. 然后我可以直接 ssh 没有问题。

在身份验证日志中,我看到以下错误

Sep 5 14:24:24 node2 sshd[1798]: Connection closed by authenticating user vagrant 10.0.2.2 port 59816 [preauth]

这可能是一些阻止它工作的配置。

 ssh  [email protected] -p 2204
 Warning: Permanently added '[127.0.0.1]:2204' (ECDSA) to the list of known hosts.
 [email protected]: Permission denied (publickey).

带调试的 SSH

 ssh -v [email protected] -p 2204
 OpenSSH_8.0p1, OpenSSL 1.1.1c  28 May 2019
 debug1: Reading configuration data /home/aaron/.ssh/config
 debug1: /home/aaron/.ssh/config line 14: Applying options for 127.0.0.1
 debug1: /home/aaron/.ssh/config line 69: Applying options for *
 debug1: Reading configuration data /etc/ssh/ssh_config
 debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2204.
 debug1: Connection established.
 debug1: identity file /home/aaron/.ssh/ansible_id_rsa type 0
 debug1: identity file /home/aaron/.ssh/ansible_id_rsa-cert type -1
 debug1: identity file /home/aaron/.ssh/id_ed25519 type 3
 debug1: identity file /home/aaron/.ssh/id_ed25519-cert type -1
 debug1: Local version string SSH-2.0-OpenSSH_8.0
 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
 debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
 debug1: Authenticating to 127.0.0.1:2204 as 'vagrant'
 debug1: SSH2_MSG_KEXINIT sent
 debug1: SSH2_MSG_KEXINIT received
 debug1: kex: algorithm: curve25519-sha256
 debug1: kex: host key algorithm: ecdsa-sha2-nistp256
 debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
 debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
 debug1: Server host key: ecdsa-sha2-nistp256 SHA256:dkycbxm6Tr8t45KCUiMbAauvQTtw6+go3sss3nk+nrY
 debug1: checking without port identifier
 Warning: Permanently added '[127.0.0.1]:2204' (ECDSA) to the list of known hosts.
 debug1: rekey out after 134217728 blocks
 debug1: SSH2_MSG_NEWKEYS sent
 debug1: expecting SSH2_MSG_NEWKEYS
 debug1: SSH2_MSG_NEWKEYS received
 debug1: rekey in after 134217728 blocks
 debug1: Will attempt key: /home/aaron/.ssh/id_ed25519 ED25519 SHA256:RVSwD4SH/PoB+hUiP/wjyEtb+CST8QgPPNl3SO3zuBg explicit agent
 debug1: Will attempt key: /home/aaron/.ssh/ansible_id_rsa RSA SHA256:iIXdS4I0sfQFx+Hlb3EtA4iMZDaKVvTDP1Cwj2MUohI explicit agent
 debug1: Will attempt key:  RSA SHA256:XBZaVosr5ppZecW61cMWfduIETMDKrjAfVle2vaU6Uk agent
 debug1: SSH2_MSG_EXT_INFO received
 debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
 debug1: SSH2_MSG_SERVICE_ACCEPT received
 debug1: Authentications that can continue: publickey
 debug1: Next authentication method: publickey
 debug1: Offering public key: /home/aaron/.ssh/id_ed25519 ED25519 SHA256:RVSwD4SH/PoB+hUiP/wjyEtb+CST8QgPPNl3SO3zuBg explicit agent
 debug1: Authentications that can continue: publickey
 debug1: Offering public key: /home/aaron/.ssh/ansible_id_rsa RSA SHA256:iIXdS4I0sfQFx+Hlb3EtA4iMZDaKVvTDP1Cwj2MUohI explicit agent
 debug1: Authentications that can continue: publickey
 debug1: Offering public key:  RSA SHA256:XBZaVosr5ppZecW61cMWfduIETMDKrjAfVle2vaU6Uk agent
 debug1: Authentications that can continue: publickey
 debug1: No more authentication methods to try.
 [email protected]: Permission denied (publickey).

Vagrant up 终端输出

vagrant up
Bringing machine 'mgmt' up with 'virtualbox' provider...
Bringing machine 'node1' up with 'virtualbox' provider...
Bringing machine 'node2' up with 'virtualbox' provider...
==> mgmt: Checking if box 'ubuntu/bionic64' version '20190828.0.0' is up to date...
==> mgmt: Clearing any previously set forwarded ports...
==> mgmt: Clearing any previously set network interfaces...
==> mgmt: Preparing network interfaces based on configuration...
    mgmt: Adapter 1: nat
    mgmt: Adapter 2: hostonly
==> mgmt: Forwarding ports...
    mgmt: 22 (guest) => 2202 (host) (adapter 1)
==> mgmt: Running 'pre-boot' VM customizations...
==> mgmt: Booting VM...
==> mgmt: Waiting for machine to boot. This may take a few minutes...
    mgmt: SSH address: 127.0.0.1:2202
    mgmt: SSH username: vagrant
    mgmt: SSH auth method: private key
==> mgmt: Machine booted and ready!
==> mgmt: Checking for guest additions in VM...
    mgmt: The guest additions on this VM do not match the installed version of
    mgmt: VirtualBox! In most cases this is fine, but in rare cases it can
    mgmt: prevent things such as shared folders from working properly. If you see
    mgmt: shared folder errors, please make sure the guest additions within the
    mgmt: virtual machine match the version of VirtualBox you have installed on
    mgmt: your host and reload your VM.
    mgmt: 
    mgmt: Guest Additions Version: 5.2.32
    mgmt: VirtualBox Version: 6.0
==> mgmt: Setting hostname...
==> mgmt: Configuring and enabling network interfaces...
==> mgmt: Mounting shared folders...
    mgmt: /vagrant => /run/media/aaron/nixdata/Source/ansible-docker/vagrant/swarm
==> mgmt: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> mgmt: flag to force provisioning. Provisioners marked to run always will still run.
==> node1: Checking if box 'ubuntu/bionic64' version '20190828.0.0' is up to date...
==> node1: Clearing any previously set forwarded ports...
==> node1: Clearing any previously set network interfaces...
==> node1: Preparing network interfaces based on configuration...
    node1: Adapter 1: nat
    node1: Adapter 2: hostonly
==> node1: Forwarding ports...
    node1: 22 (guest) => 2203 (host) (adapter 1)
==> node1: Running 'pre-boot' VM customizations...
==> node1: Booting VM...
==> node1: Waiting for machine to boot. This may take a few minutes...
    node1: SSH address: 127.0.0.1:2203
    node1: SSH username: vagrant
    node1: SSH auth method: private key
==> node1: Machine booted and ready!
==> node1: Checking for guest additions in VM...
    node1: The guest additions on this VM do not match the installed version of
    node1: VirtualBox! In most cases this is fine, but in rare cases it can
    node1: prevent things such as shared folders from working properly. If you see
    node1: shared folder errors, please make sure the guest additions within the
    node1: virtual machine match the version of VirtualBox you have installed on
    node1: your host and reload your VM.
    node1: 
    node1: Guest Additions Version: 5.2.32
    node1: VirtualBox Version: 6.0
==> node1: Setting hostname...
==> node1: Configuring and enabling network interfaces...
==> node1: Mounting shared folders...
    node1: /vagrant => /run/media/aaron/nixdata/Source/ansible-docker/vagrant/swarm
==> node1: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> node1: flag to force provisioning. Provisioners marked to run always will still run.
==> node2: Importing base box 'ubuntu/bionic64'...
==> node2: Matching MAC address for NAT networking...
==> node2: Checking if box 'ubuntu/bionic64' version '20190828.0.0' is up to date...
==> node2: Setting the name of the VM: swarm_node2_1567690918350_55935
==> node2: Clearing any previously set network interfaces...
==> node2: Preparing network interfaces based on configuration...
    node2: Adapter 1: nat
    node2: Adapter 2: hostonly
==> node2: Forwarding ports...
    node2: 22 (guest) => 2204 (host) (adapter 1)
==> node2: Running 'pre-boot' VM customizations...
==> node2: Booting VM...
==> node2: Waiting for machine to boot. This may take a few minutes...
    node2: SSH address: 127.0.0.1:2204
    node2: SSH username: vagrant
    node2: SSH auth method: private key
    node2: Warning: Connection reset. Retrying...
    node2: Warning: Remote connection disconnect. Retrying...
    node2: 
    node2: Vagrant insecure key detected. Vagrant will automatically replace
    node2: this with a newly generated keypair for better security.
    node2: 
    node2: Inserting generated public key within guest...
    node2: Removing insecure key from the guest if it's present...
    node2: Key inserted! Disconnecting and reconnecting using new SSH key...
==> node2: Machine booted and ready!
==> node2: Checking for guest additions in VM...
    node2: The guest additions on this VM do not match the installed version of
    node2: VirtualBox! In most cases this is fine, but in rare cases it can
    node2: prevent things such as shared folders from working properly. If you see
    node2: shared folder errors, please make sure the guest additions within the
    node2: virtual machine match the version of VirtualBox you have installed on
    node2: your host and reload your VM.
    node2: 
    node2: Guest Additions Version: 5.2.32
    node2: VirtualBox Version: 6.0
==> node2: Setting hostname...
==> node2: Configuring and enabling network interfaces...
==> node2: Mounting shared folders...
    node2: /vagrant => /run/media/aaron/nixdata/Source/ansible-docker/vagrant/swarm
==> node2: Running provisioner: shell...
    node2: Running: inline script
    node2: hello from node2 worker

从身份验证日志 /var/log/auth 中提取。

Sep  5 13:41:24 node2 systemd-logind[842]: Watching system buttons on /dev/input/event0 (Power Button)
Sep  5 13:41:24 node2 systemd-logind[842]: Watching system buttons on /dev/input/event1 (Sleep Button)
Sep  5 13:41:24 node2 systemd-logind[842]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)
Sep  5 13:41:24 node2 systemd-logind[842]: New seat seat0.
Sep  5 13:41:24 node2 sshd[995]: Server listening on 0.0.0.0 port 22.
Sep  5 13:41:24 node2 sshd[995]: Server listening on :: port 22.
Sep  5 13:41:28 node2 sshd[1216]: Accepted publickey for vagrant from 10.0.2.2 port 58726 ssh2: RSA SHA256:1ZgLBFBYfTGKpryguu9GYmEYe7jw5DVr3qAVEpmi+jQ
Sep  5 13:41:28 node2 sshd[1216]: pam_unix(sshd:session): session opened for user vagrant by (uid=0)
Sep  5 13:41:28 node2 systemd-logind[842]: New session 1 of user vagrant.
Sep  5 13:41:28 node2 systemd: pam_unix(systemd-user:session): session opened for user vagrant by (uid=0)
Sep  5 13:41:30 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:30 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:30 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:40 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:40 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:40 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:40 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:40 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:40 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:40 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:40 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:41 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:41 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:41 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:41 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:41 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:42 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:42 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:42 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:41:42 node2 sudo:  vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash -l
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep  5 13:41:42 node2 sudo: pam_unix(sudo:session): session closed for user root
Sep  5 13:42:43 node2 sshd[1216]: pam_unix(sshd:session): session closed for user vagrant
Sep  5 13:42:43 node2 systemd-logind[842]: Removed session 1.
Sep  5 13:42:43 node2 systemd: pam_unix(systemd-user:session): session closed for user vagrant
Sep  5 14:00:26 node2 sshd[1777]: Connection closed by authenticating user vagrant 10.0.2.2 port 59192 [preauth]
Sep  5 14:08:22 node2 sshd[1780]: Connection closed by authenticating user vagrant 10.0.2.2 port 59362 [preauth]
Sep  5 14:08:40 node2 sshd[1783]: Connection closed by authenticating user vagrant 10.0.2.2 port 59382 [preauth]
Sep  5 14:17:01 node2 CRON[1786]: pam_unix(cron:session): session opened for user root by (uid=0)
Sep  5 14:17:01 node2 CRON[1786]: pam_unix(cron:session): session closed for user root
Sep  5 14:20:21 node2 sshd[1795]: Connection closed by authenticating user vagrant 10.0.2.2 port 59798 [preauth]
Sep  5 14:24:24 node2 sshd[1798]: Connection closed by authenticating user vagrant 10.0.2.2 port 59816 [preauth]
Sep  5 14:24:32 node2 sshd[1800]: Accepted publickey for vagrant from 10.0.2.2 port 59820 ssh2: RSA SHA256:1ZgLBFBYfTGKpryguu9GYmEYe7jw5DVr3qAVEpmi+jQ
Sep  5 14:24:32 node2 sshd[1800]: pam_unix(sshd:session): session opened for user vagrant by (uid=0)
Sep  5 14:24:32 node2 systemd-logind[842]: New session 4 of user vagrant.
Sep  5 14:24:32 node2 systemd: pam_unix(systemd-user:session): session opened for user vagrant by (uid=0)
Sep  5 14:24:48 node2 sudo:  vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/bash
Sep  5 14:24:48 node2 sudo: pam_unix(sudo:session): session opened for user root by vagrant(uid=0)
Sep  5 14:26:02 node2 sshd[1938]: Postponed publickey for vagrant from 10.0.2.2 port 59824 ssh2 [preauth]
Sep  5 14:26:02 node2 sshd[1938]: Accepted publickey for vagrant from 10.0.2.2 port 59824 ssh2: RSA SHA256:1ZgLBFBYfTGKpryguu9GYmEYe7jw5DVr3qAVEpmi+jQ
Sep  5 14:26:02 node2 sshd[1938]: pam_unix(sshd:session): session opened for user vagrant by (uid=0)
Sep  5 14:26:02 node2 systemd-logind[842]: New session 6 of user vagrant.
Sep  5 14:26:04 node2 sshd[2004]: Received disconnect from 10.0.2.2 port 59824:11: disconnected by user
Sep  5 14:26:04 node2 sshd[2004]: Disconnected from user vagrant 10.0.2.2 port 59824
Sep  5 14:26:04 node2 sshd[1938]: pam_unix(sshd:session): session closed for user vagrant
ssh linux
  • 1 1 个回答
  • 1291 Views

1 个回答

  • Voted
  1. Best Answer
    nelaaro
    2019-09-10T04:07:23+08:002019-09-10T04:07:23+08:00

    在对我的流浪文件进行了一些更改之后。具体不使用box = 'ubuntu/bionic64',使用推荐的box = "bento/ubuntu-18.04

    便当项目

    这些盒子是使用 Chef's Bento 项目中的模板构建的。如果您发现任何错误,请打开一个问题或发送拉取请求。谢谢!

    他们在启动时按预期工作,我可以 ssh。

    此vlogger建议仅将 hashcorp 或 Bento 项目图像用于 vagrant。因为他们往往工作得更好并有更好的支持。就我而言,情况似乎如此。

    • 1

相关问题

  • 需要 LDAP 身份验证 * 和 * ssh 身份验证

  • 加载密钥“ec256.pem”:尝试从私钥生成公钥时抛出无效格式

  • 如何在域和 Linux 活动目录中启用指纹传感器

  • 如何在CentOS 7 中将Ctrl+C 永久更改为Ctrl+K?

  • 为什么 chown 600 id_rsa 修复权限问题?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    Windows 10 服务称为 AarSvc_70f961。它是什么,我该如何禁用它?

    • 2 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Marko Smith

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1056)

    • 4 个回答
  • Marko Smith

    我如何知道 Windows 安装在哪个驱动器上?

    • 6 个回答
  • Martin Hope
    Albin 支持结束后如何激活 WindowsXP? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch Windows 10 删除大量小文件的速度非常慢。有什么办法可以加快速度吗? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Ctrl+C 和 Ctrl+V 是如何工作的? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve