Skip to content

Instantly share code, notes, and snippets.

@kentliau
kentliau / ssh_without_pem
Created August 19, 2023 04:10 — forked from kevinjam/ssh_without_pem
Access EC2 Linux box over ssh without .pem file SHELL SSH AWS AMAZON LINUX EC2 BASH You may be in the situation where you need to access your EC2 instance from any machine, not necessarily your own. It's a pain to carry around your .pem file and a bad idea to leave it on someone elses machine too. Here's a solution to let you login to your insta…
1. Login to your EC2 instance using your .pem file
ssh -i your_pem_file.pem ubuntu@ec2-________.compute-1.amazonaws.com
2. Create a new user that will access the instance using a password:
$ sudo useradd -s /bin/bash -m -d /home/USERNAME -g root USERNAME
where:
-s /bin/bash : use /bin/bash as the standard shell
-m -d /home/USERNAME : create a home directory at /home/USERNAME
@kentliau
kentliau / prezto.sh
Last active December 5, 2023 05:47 — forked from arvind-iyer/prezto.sh
Install prezto on ubuntu
#!/bin/bash
prezto.sh(){
#clear
#sudo apt-get install -y git
#sudo apt-get update && sudo apt-get install -y zsh
# Get prezto
#git clone --recursive https://github.com/sorin-ionescu/prezto.git ~/.zprezto
# Backup zsh config if it exists