Setting password protection in Vagrant

First, SSH into the server and issue passwd to change password. Might have to change password policy as it's too strict and the error message BAD PASSWORD: it is based on a dictionary word is displayed. To change it edit /etc/pam.d/system-auth. The original file looks like this (source):

password requisite pam_cracklib.so try_first_pass retry=3 password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok password required pam_deny.so

Comment all the three lines

```

password requisite pam_cracklib.so try_first_pass retry=3

password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok

password required pam_deny.so

```

Add this line

password sufficient /lib/security/$ISA/pam_unix.so nullok md5 shadow

It will look like this now

```

password requisite pam_cracklib.so try_first_pass retry=3

password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok

password required pam_deny.so

password sufficient /lib/security/$ISA/pam_unix.so nullok md5 shadow ```

Note: If you run authconfig, the file /etc/pam.d/system-auth will be overwritten.

Second, issue vagrant ssh-config and move or delete the key file listed. Third, open ports with vboxmanage modifyvm $MACHINE_NAME_FROM_VBOX_GUI --natpf1 "pf-test1,tcp,,$PORT,,$PORT".

Resolving SSH issues with Vagrant

$ vagrant up huha Bringing machine 'huha' up with 'virtualbox' provider... ==> huha: Clearing any previously set forwarded ports... ==> huha: Clearing any previously set network interfaces... ==> huha: Preparing network interfaces based on configuration... huha: Adapter 1: nat huha: Adapter 2: hostonly ==> huha: Forwarding ports... huha: 8080 (guest) => 8080 (host) (adapter 1) huha: 8443 (guest) => 8443 (host) (adapter 1) huha: 22 (guest) => 2222 (host) (adapter 1) ==> huha: Running 'pre-boot' VM customizations... ==> huha: Booting VM... ==> huha: Waiting for machine to boot. This may take a few minutes... huha: SSH address: 127.0.0.1:2222 huha: SSH username: vagrant huha: SSH auth method: private key Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period.

Tried to see what the problem is: $ ssh -vvv vagrant@127.0.0.1 -p 2222 OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: resolving "127.0.0.1" port 2222 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222. debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_rsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/user1/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 ssh_exchange_identification: read: Connection reset by peer

In the end it was just that the Bridge Connection option in VirtualBox's Settings > Network > Adapter 1 was disabled.

Misconfigured hosts file leads to hadoop file copy error

Got this error: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: :50010, which turns out to have been caused by the hosts file containing an empty entry i.e. 192.168.33.10

GitHub – jonyt

Jon Yom-Tov