AWS EC2
- Launch an EC2 instance on the Amazon Linux machine.
- Connect to the instance via SSH
check details:
- Open a terminal or command prompt on your local machine.
- Locate your private key file (.pem) that you have created or downloaded when you launched your EC2 instance. Note: If you don’t have a key pair, you can create a new one in the EC2 console.
- Change the permission of the key pair file using the command:
chmod 400 /path/to/your/key.pem
- Connect to your EC2 instance using the command:
ssh -i /path/to/your/key.pem ec2-user@your_ec2_instance_public_ip
Update the package list by running the command:
sudo yum update -y
Install pip and python3 by running the command:
sudo yum install python3-pip -y
Install Jupyter Notebook by running the command:
pip3 install jupyter
Generate the Jupyter configuration file by running the command:
jupyter notebook --generate-config
Set a password for Jupyter Notebook by running the command:
jupyter notebook password
Create a new SSL certificate by running the command:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
Start the Jupyter Notebook server by running the command:
jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --certfile=mycert.pem --keyfile=mykey.key
Open your web browser and access the Jupyter Notebook by entering the URL
https://<your_ec2_instance_public_ip>:8888
.How to add a new key pair to your existing AWS EC2 Instances https://linux.how2shout.com/add-a-new-key-pair-to-your-exisitng-aws-ec2-instances/