I was working to delete a single file.
I accidentally typed /* and all files are gone. It's okay since I have my backups but the main problem is that I'm not able to login into aws ec2 instance. Can anyone help me out?
You won't be able to login into the instance because you tore it down with that command. You should login to the EC2 dashboard (or use the aws-console) and terminate the instance and / or start a new one from the image backup you may have.
Related
I am facing a strange issue. Currently I am working over deployment and configuration of few services over AWS over multiple instances. I have been creating multiple EC2 Instances and deploying required services over it. To start my jars, I have written a script. Ubuntu asks me to broaden the permissions for running the script. Since it is a test server, I have been granting 777 permissions to the ubuntu user as below -
Ubuntu User Home Path = /home/ubuntu, Script Path = /home/ubuntu/IASQueueBuilder/scripts
I am not sure what exactly goes wrong but after few mins, I get kicked out of ssh and then I can never ssh again to that instance.
To troubleshoot this, I have created a new instance and this time just gave 777 permissions to the script I have to run and nothing strange happens.
Can anyone help me figure the reasoning behind this? I have done some homework and I could see there are multiple issues with ssh to AWS Instances. Few are as below -
https://forums.aws.amazon.com/message.jspa?messageID=765025
https://forums.aws.amazon.com/message.jspa?messageID=246274
It looks to me like you've messed up the /home/user/.ssh directory permissions, that's why you can't access your instance now. The .ssh directory should have 700 permissions. You can fix this and access your instance by doing the following:
Stop your instance
Detach the volume
Create new instance
Attach the volume from your problematic instance to the new instance
Mount it on /mnt/something or where ever you want so that you could
have access to it
Manually fix the permissions of .ssh directory. One you're done, detach the volume from instance #2 and attach it to your main instance.
Also, consider snapshot-ing your instances, or at least the one with important data. It never hurts to have a backup.
I recently downloaded and managed to start an OrientDB server/database on an AWS EC2 Linux 14.04 (I think the name is) server for an application I want to set up. I started OrientDB "as usual" by running ./server.sh in the terminal via SSH link to the EC2 server. All works fine and I can query the database while at the computer. But as soon as I leave my computer and the SSH link is broken (for example when closing the computer), so is the database, i.e. it stops.
Is there a way to go around this or do I have to set up the database in some other way?
OrientDB is provided as AWS AMI. Take a look to
http://orientdb.com/orientdb-amazon-web-services/
If you want to DIY, follow the instructions provided on
http://orientdb.com/docs/last/Unix-Service.html
Update: new link to doc:
https://orientdb.com/docs/last/admin/Unix-Service.html
Hope this helps
you can try putting full path to server.sh into /etc/rc.local before exit 0 and reboot the instance
Before running the server, run the command:
screen
This will create a persistent environment which will allow your process to keep running after you disconnect.
When you reconnect, you can use this command to reconnect to that environment:
screen -r
I have got an Amazon EC2 instance. I edited etc/profile, which has resulted in something terrible. Now, I am not able to connect to the instance from Filezilla. I am able to connect through putty but the terminal opens with lot of text. I am definitely sure this is all because of something accidental changes that I created in profile.
Is there any way I can reset etc/profile to its earlier version?
There is no way to revert to the previous version if you dont have a backup of the file / snapshot of the instance ...
Depends if you already made change but if you want the default version, you can spin up a new ec2 instance of the same type, copy the /etc/profile from the new instance into your current instance. All this can be done within an hour so it will cost you only 1 hour of an additional ec2 instance.
I was wondering if I could use a shell script on a remote server to create an amazon EC2 instance from an existing saved snapshot, and also delete that instance too.
I was sure it was possible, but I havent been able to run any example code to do it so im starting to doubt it now.
So, can anyone tell me how this is done please?
There is a quite detailed description on the Amazon webpage how to do this:
http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/Welcome.html
At which point are you struggling?
I have a customer who wishes me to do some customisations of the erp system opentaps, which they used via opentaps Amazon Elastic Computing Cloud (EC2) images, I've only worked with it on a normal server and don't know anything about images in the cloud. When I ssh in with the details the client gave me there is no sign of the erp installation directory I'd expect to see. I did originally expect that the image wouldn't be accessible, but the client assured me it was. I suppose they could be confused.
Would one have to create a new image and swap it out or is there a way to alter the source and rebuild like on a normal server?
Something is not quite clear to me here. First of all EC2 images running in the cloud are just like normal virtual servers, so If you have an access to the running instance there is no difference between instance in the cloud and instance on another pc in your home for example.
You have to find out how opentaps are installed on the provided amis, then do your modifications, create an image from the modified instance and save it to s3 for backup if necessary.
If you want to start with fresh instance, you can start up any linux/windows distro on the EC2, install opentaps yourself your way and you are done.