Waiting for SSH to become available...

2,253 views
Skip to first unread message

Sonali Prasad

unread,
Oct 3, 2022, 9:56:30 PM10/3/22
to Packer
Hi Team, 

Can anyone help me with the issue with hcpacker:

==> vsphere-iso.linux-ubuntu-server: Waiting for SSH to become available...
==> vsphere-iso.linux-ubuntu-server: Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> vsphere-iso.linux-ubuntu-server: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> vsphere-iso.linux-ubuntu-server: Step "StepConnect" failed

Regards,
Sonali 

Pravin Kumar

unread,
Oct 4, 2022, 1:06:12 AM10/4/22
to Packer
Please check the ssh user and password as it is not able to authenticate the user, meanwhile you can share the json file content here

Mudit

unread,
Oct 4, 2022, 3:27:02 AM10/4/22
to packe...@googlegroups.com
Please check the path of the ssh keys.We had similar issue and we resolved with
Giving correct permission for the script which was pulling ssh keys from GCP storage
Verify the path of the ssh keys


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/71d45d02-54ee-4b11-a0c7-1d495af50529n%40googlegroups.com.

Sonali Prasad

unread,
Oct 4, 2022, 4:11:50 AM10/4/22
to packe...@googlegroups.com
I have created the ssh-key on my terminal and used it under cloud-init/user-data file.
I am calling ssh-username and ssh-password for logging in to the machine.
Could you please share your sample code with me, where you are giving the ssh key path?

Sonali Prasad

unread,
Oct 4, 2022, 10:12:24 AM10/4/22
to packe...@googlegroups.com
ssh-username and password are the one which we create right ? 
I am using hcl code:
This is my user-data file:
#cloud-config
autoinstall:
    version: 1
    early-commands:
        # workaround to stop ssh for packer as it thinks it timed out
        - sudo systemctl stop ssh
    locale: en_US
    keyboard:
        layout: en
        variant: us
    packages: [open-vm-tools, openssh-server, net-tools, perl, open-iscsi, ntp, curl, vim, ifupdown, zip, unzip, gnupg2, software-properties-common, apt-transport-https, ca-certificates, lsb-release, python3-pip, jq, openvpn]
    network:
        network:
            version: 2
            ethernets:
                ens192:
                    dhcp4: true
    identity:
        hostname: ubuntu-server
        username: ubuntu
        password: test12345
    ssh:
        install-server: yes
        allow-pw: yes
        authorized-keys:
            - ssh-rsa <public key>
    storage:
        layout:
            name: lvm
    user-data:
        disable_root: false
    late-commands:
        - echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
        - curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/ubuntu
        - apt update -y
        - apt install cloud-init -y
        - apt install openssh-server -y
        - apt install nfs-common nfs-kernel-server -y
        - cat <<EOF > /etc/resolv.conf
        nameserver <nameserver ip>
        EOF
        - apt install iputils-ping open-vm-tools openssh-server net-tools perl open-iscsi ntp curl vim ifupdown zip unzip gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release python3-pip jq openvpn -y
        - service vmtoolsd restart

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/o7TfwsWLcuo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool...@googlegroups.com.

Sonali Prasad

unread,
Oct 4, 2022, 10:13:59 AM10/4/22
to packe...@googlegroups.com
This is just a dummy username and password. 
I believe this is the place where we create the username and password right ?

Reply all
Reply to author
Forward
0 new messages