ssh -i "id_key.pem" ubuntu@123.12.12.123 cd /etc/ssh/ nano ssh_config ///uncomment - PasswordAuthentication yes cd sshd_config.d ls nano 60-cloudimg-settings.conf ///PasswordAuthentication yes passwd ubuntu systemctl restart ssh make a .ssh folder, if it does not exist
(In my local terminal) ssh-keygen -t rsa scp /home/tantra/.ssh/id_rsa.pub ubuntu@13.202.98.233:~/.ssh/authorized_keys if .ssh folder does not exist on server, make one by mkdir .ssh ssh ubuntu@13.202.98.233 ///automatically connects, no need for password.
(lekin ye ek baar hi kaam krega, local terminal close krne pr sb khtm) alias connect="ssh ubuntu@12.12.12.12" ///when you type connect in terminal, it will perform ssh NOTE: alias connect="ssh raju@12.12.12.12" ///this will REWRITE the alias
cd /home/tantra (home dir) ls -a ///.bashrc file nano .bashrc /// edit in last line, alias cc="clear" alias connect="ssh ubuntu@13.202.98.233" OR ALSO: alias codeblogs.fun="ssh ubuntu@codeblogs.fun" ctrl+x y enter (save it) source .bashrc ///reload all changes codeblogs.fun ///Enter. That's it!
sudo -i hostnamectl set-hostname NEWNAME ///exit and login again hostname ///check hostname
For detailed instructions, check out the Learn More page.