AWS EC2 default password - amazon-web-services

I'm following this tutorial to host a website with an apache server. The thing is that the last step tells my to do
service apache2 reload
But it asks me for a password. I don't remember inserting a password for this VM, just the .pem I used to log in.
Is there a default password? Or how can I solve this? Sorry if this is basic, but the most complex thing I've done with servers is with wamp and xamp
Thanks!

Based on the comments, the solution was to use sudo:
sudo service apache2 reload

Related

Setting root password in GCloud VM not working

I am trying to authenticate as sudo in a linux Google Cloud VM. I know there are several similar questions, but none have solved my problem. Here's what I've tried:
Setting a password using sudo passwd, as in this answer.
Giving myself 'Compute Admin' permissions in IAM, and then running sudo passwd, as in this answer.
Running sudo invoke-rc.d procps start, as in this answer.
Running sudo passwd in the cloud shell terminal, successfully setting a password there, restarting and SSHing into my VM, and then trying to either set a password or authenticate as sudo
For all these, I am connecting using GCloud's SSH in browser. Every time, I just get prompted for the sudo password, and nothing I type in works. In case it matters, my google cloud account is associated with an institutional (university) google account.
I'm at a loss here. Any suggestions are much appreciated!
By default password based authentication and root login is disabled in GCP vms, so if you are trying to do password based ssh first you need to enable it follow this documentation for enabling password based access but it is not suggested to enable password based authentication as it makes your environment vulnerable. As you are saying your terminal is getting stuck have you checked the resource utilisations of cpu and memory.

what is the default password for the `jupyter` user on AI platform notebook VMs?

i just tried to install oh-my-zsh on my notebook instance. it asked for the jupyter user's password, but i have no idea.
i'm also tagging with gcp-ai-platform-notebook as the support page says to do. thanks in advance for any help here!
I tried to install oh-my-zsh using “sudo -i" to login as root. It’s installed successfully. So, I would advise you to use “sudo -i” to login as root before installing oh-my-zsh.
You can change the password using the following
sudo passwd <username>
You will require sudo permissions. This can be done by adding Compute Admin role to the service account and restarting the VM

Django API works locally but not when deployed on Elastic Beanstalk

I'm working with Django Rest Framework and Django Rest Framework JWT, but I'm running into an issue in regards to local behavior vs external behavior.
When I make a POST request to get a JWT token, everything works as desired both locally and on my EC2 instance. However, once I have the token, when I make a request to my server that requires authentication, only my local server returns the expected response. On my deployed server, I get the following error:
{"detail":"Authentication credentials were not provided."}
What I've tried so far:
Editing http.conf by sshing into my server and enabling WSGIPathAuthorization. (saw a similar post here and tried the solution)
What could be causing this behavior? My local machine and my deployed code are identical, leading me to believe that this has something to do with server-side configuration.
All help is appreciated. Thanks!
You mentioned ElasticBeanstalk.
You can add this to your container commands which will be executed during deployment.
01_wsgipass:
command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'
Simply restarting Apache after enabling WSGPPathAuthorization fixed my error. For those of you who encounter something similar, here's what I did:
SSH into the server
Navigate to where your http.conf file is stored (in Apache, this is usually
etc/httpd/http.conf)
Edit http.conf, adding WSGIPathAuthorization On.
Restart Apache by running sudo service httpd restart.
This problem usually occurs when you do configure wsgi with apache on EC2 instance.
Bascially its the problem in apache configuration,
it has nothing to do with AWS EC2.
As apache bydefault do not process Authorization headers, so in order to make that happen we need to configure its files.
For ubuntu
cd /etc/apache2/apache2.conf
paste the following line
WSGIPassAuthorization On

Installed cPanel -amp- WHM- AMI on AWS - Can't Login to WHM or cPanel

I installed the cPanel & WHM: The Hosting Platform of Choice AMI on AWS last night on a ec2 instance.
It seems to have set it all up and I can get to the login pages of cPanel and WHM but can not log in.
I used the 1-click install and never entered, or was given a user/password combination.
Where can I find or set this information?
I can login through ssh from the aws portal and there is definitely a password set. I tried using
sudo mysql_secure_installation
to reset it but failed to login because I did not have a password. It is not blank.
I am not very familiar with doing things through SSH so please be specific on how to fix this if I need to do it through SSH.
Thank you so much for your help.
Any advice or suggestions about AWS is greatly appreciated.
I think there is an issues with the port/firewall setting. Please enable all cPanel require ports for your AWS and try to login cPanel/WHM.
Here are the all port lists which you need to enable for your server.
https://documentation.cpanel.net/pages/viewpage.action?pageId=7536715#HowtoConfigureYourFirewallforcPanel&WHM%27sServices-Ports
Amazon doesn't allow you to connect through the dashboard as root, you have to login as the user type. In this case, ec2-user. Logged in as this user doesn't allow you use the "passwd" command without the old password. However, you can authenticate as root, then use the passwd command to change the password without having to know the old one/default install. Here's how.
Log into SSH in as the ec2-user.
Run "sudo -i" to authenticate as root.
Once you're "root", you can reset the root password using "passwd".
Then login to WHM.
Looks like you've missed some step before
wget -N http://httpupdate.cpanel.net/latest
I've got the same issue and ended with deleting the instance and staring over.
The only setup guide that worked for me without any issues: https://5best.cloud/build-cpanel-cloud-hosting-amazon-aws-1/

Unable to setup Django in production on EC2 instance running Ubuntu 14.04

I have set up an EC2 instance with Ubuntu and able to login via ssh.
Now I have installed Apache, MySQL (worked fine) and Django also tried to configure it to run with apache. I have tried doing so with mod-wsgi but it still shows a apache default page instead of django (Congratulation ! It works) page. Can someone please provide me instructions for how to setup all this after login into EC2 via SSH.
Here is a tutorial provided by Django.
You need to make sure the apache config file is in /etc/apache2/sites-enabled/ or wherever your apache configuration files rest.
Another silly problem and this might be your issue is whenever I start a new instance of EC2 there is always a config called "000-default" already in the apache sites-enabled. This needs to be DELETED or DISABLED for apache to read from your config instead.
Hopefully this helps!
For a example check the Step 2 of this link. yum + git + pip + python requirements