Tuesday, March 8, 2016

Random notes: SSH tricks for Vagrant and Ambari

Follow the instructions on the following link-see the note below on logging in as root:
https://ambari.apache.org/1.2.2/installing-hadoop-using-ambari/content/ambari-chap1-5-2.html
https://ambari.apache.org/1.2.2/installing-hadoop-using-ambari/content/ambari-chap1-5-2.html

To login as root on the virtual machine:
vagrant up
vagrant ssh
sudo - root
(password vagrant-change it!!!!)

From another terminal in the Vagrant directory that you launched the VM test the connection to the vagrant VM. Vagrant installs the .ssh/id_rsa.pub to the VM
ssh vagrant@192.168.33.100


https://serversforhackers.com/ssh-tricks/

http://www.cyberciti.biz/faq/linux-unix-applesox-ssh-password-on-command-line/

http://askubuntu.com/questions/46424/adding-ssh-keys-to-authorized-keys

An alternative way to install your public key in the remote machine's
authorized_keys:
cat ~/.ssh/id_rsa.pub | ssh root@HOST "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized
 
chmod 700 ~/.ssh

chmod 600 ~/.ssh/authorized_keys 
 
Restart sshd on the remote host
 
sudo /etc/init.d/sshd restart
 
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
 
Now test the passwordless ssh login to root@host 

http://www.cyberciti.biz/tips/linux-multiple-ssh-key-based-authentication.html

https://gist.github.com/jexchan/2351996/

http://www.debian-administration.org/article/152/Password-less_logins_with_OpenSSH

https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html

https://www.racf.bnl.gov/docs/authentication/ssh/sshkeygenunix