cloud

Add Users to Google Compute Engine / EC2 Instances

KeysIn the past, when I wanted to share a Linux box with other users, it was simply by creating another user and making sure their password are ‘strong’. These days, it’s much safer not to use passwords over ssh but rather keys in order to connect (over ssh) to your machines in the cloud.

Here is the full list of commands you need to do in order to add a user. It’s being tested on Ubuntu so if you are on another OS, please continue with caution.


###################################################################################
#
# Add More Users to Google Compute Engine / EC2 Instances
# Author: Ido Green | @greenido
# Date: 21/SEP/2015
#
###################################################################################
# If you wish to use passwords ignore this flag of –disabled-password
sudo adduser newuser-name –disabled-password
sudo su – newuser-name
mkdir .ssh
chmod 700 .ssh
touch .ssh/authorized_keys
# (!) Important – without these exact file permissions, you will not be able to
# log into this account using SSH.
chmod 600 .ssh/authorized_keys
# Edit the authorized_keys file and paste the public key for your key pair
# into the file. It should like:
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClKsfkNkuSevGj3eYhCe53pcjqP3maAhDFcvBS7O6V
# Make sure to copy just the key without any spaces before/after it!
vi .ssh/authorized_keys
# Retrieving the Public Key from your private key file
# If you don't have your publich key (just the file of the private key)
# This is what you need to do in order to extract it:
chmod 400 the-new-key.pem
ssh-keygen -y
# When prompted to enter the file in which the key is, specify
# the path to your .pem file. For example:
/path_to_key_pair/the-new-key.pem
# You will get something like:
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClKsfkNkuSevGj3eYhCe
# 53pcjqP3maAhDFcvBS7O6Vhz2ItxCih+PnDSUaw+WNQn/mZphTk/ab/wB96x
# Make sure to copy it without any spaces before/after
####
#
# Now, hold you finger and try to connect
#
####
ssh -i my_key.pem newuser-name@11.11.11.11
# If things are not going well try:
ssh -v -i my_key.pem newuser-name@11.11.11.11
# You should get the full details why things are not working.
# Another option: tail -f -n 80 /var/log/auth.log on the remote box
# If you wish to remove the user
sudo userdel -r olduser

Misc

Standard
Chrome, HTML5, JavaScript, webdev

Install Ubuntu On Your Chromebook

chromebook 5

Chromebook For Developers And Hackers

If you are a Linux hacker and/or a developer with a new Chromebook, Chromebox, Pixel or an old laptop with ChromeOS… You might want to have the ability to have a dual-boot option that will let you enjoy the power of your ChromeOS but on the same time be able to boot your laptop with Linux and enjoy C, C++, Java and the fun technologies. It might be hard on other platforms to ‘hack’ them, but since the chromium project is open-source, I guess, they wanted to be hackable by design (e.g. you have a keyboard shortcuts in Pixel that let you enter this mode). Here are the few steps you need to follow in order to enjoy hacking ChromeOS. Continue reading

Standard