Can't login in ssh terminal my aws ubuntu.

0

This is result of ssh open:

Using username "ubuntu". Authenticating with public key "imported-openssh-key" Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-1012-aws x86_64)

System information as of Fri Sep 20 21:13:56 UTC 2024

System load: 0.08 Processes: 108 Usage of /: 40.4% of 6.71GB Users logged in: 0 Memory usage: 48% IPv4 address for enX0: ipaddress Swap usage: 0%

Expanded Security Maintenance for Applications is not enabled.

9 updates can be applied immediately. 9 of these updates are standard security updates. To see these additional updates run: apt list --upgradable

Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status

*** System restart required *** Last login: Fri Sep 20 21:12:42 2024 from ipaddress Command 'lesspipe' is available in the following places

  • /bin/lesspipe
  • /usr/bin/lesspipe The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable. lesspipe: command not found Command 'dircolors' is available in the following places
  • /bin/dircolors
  • /usr/bin/dircolors The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable. dircolors: command not found ubuntu@ip-address:~$

I don't have any idea to solve this. Thanks and best regards.

asked 2 months ago86 views
7 Answers
0
Accepted Answer

Cezar, taking your three recent updates together it sounds for all the world like your original EC2 instance, which had an /etc/environment file as well as having Tomcat and Java installed, has been terminated and a new instance has been spun up to replace it, which doesn't have any of those things on it.

This would also explain why your target group is now unhealthy.

The mention of a target group is interesting, because that implies there's a load balancer too, suggesting this is a more complex environment than just a single Ubuntu EC2 instance.

I'm then wondering if there's an auto-scaling group as well, which may have launched a new instance but the customisation step didn't complete successfully https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html

Long story short, I think there are many more moving parts to this than you have put in your question (or maybe you are just not aware of them).

profile picture
EXPERT
answered 2 months ago
0

Hi, in my target group I have unhealthy field set to 1, what its mean?

answered 2 months ago
0

Which Ubuntu AMI is the EC2 provisioned from, is it an unmodified one provided by the vendor, or a customised one for your organisation?

It looks like the ubuntu user's login profile is trying to run lesspipe and dircolors but without the absolute path to them.

Both commands are on the system in /bin and /usr/bin but these arent in the ubuntu user's $PATH. To fix this you need to find the script from where they are run - start by looking at .bashrc and .bash_profile in the ubuntu user's homedir which is probably /home/ubuntu - and change lesspipe and dircolors to the full path.

The other option is to append /bin and /usr/bin to $PATH earlier, before lesspipe and dircolors are run.

profile picture
EXPERT
answered 2 months ago
0

Until yesterday morning I had the /etc/environment file with path set including path to the java package but today this file is empty, why?

answered 2 months ago
0

How I said until yesterday morning I had installed in my ubuntu java and tomcat today I don't have anything installed, by ssh putty I don't have any access to the commands linux in the aws terminal I can't doing things as open /etc/environment and save with vim editor, once again, why, what is happening? I believe that I lost my EC2 instance ubuntu.

answered 2 months ago
0

Hi Steve, I will recreate my instance, do you have any tips for me to create the instance?

answered 2 months ago
0

Hi, sorry by delay, after delete and recreate the instance without load balancer I solved my problem, thanks and best regards.

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions