unrecognized command in my ec2 instance history.

0

I have these two unrecognized commands in my ec2 instance history. I am not sure who has executed these and what does it do.

1.builtin printf "\e[?1049l"

2.if [ "$_termius_integration_installed" = "" ]; then _termius_integration_installed="yes"; builtin printf "\e]4545;A\a"; _termius_encode() { builtin echo -n "$1" | command base64; }; _termius_get_trap() { builtin local -a terms; builtin eval "terms=( $(trap -p "${1:-DEBUG}") )"; builtin printf '%s' "${terms[2]:-}"; }; if [[ "$HISTCONTROL" =~ .(erasedups|ignoreboth|ignoredups). ]]; then _termius_history_verify=0; else _termius_history_verify=1; fi; _termius_original_PS1="$PS1"; _termius_custom_PS1=""; _termius_in_command_execution="1"; _termius_current_command=""; _termius_current_cwd() { builtin printf "\e]4545;SetCwd;%s\a" "$(_termius_encode "$PWD")"; }; _termius_prompt_begins() { builtin printf "\e]4545;ShellPromptBegins\a"; }; _termius_prompt_ends() { builtin printf "\e]4545;ShellPromptEnds\a"; }; _termius_wrap_prompt() { builtin printf "[$(_termius_prompt_begins)]%s[$(_termius_prompt_ends)]" "$1"; }; _termius_command_started() { builtin printf "\e]4545;CommandStarted;%s\a" "$(_termius_encode "$1")"; }; _termius_command_exited() { builtin printf "\e]4545;CommandExited;%s\a" "$1"; }; _termius_update_prompt() { if [ "$_termius_in_command_execution" = "1" ]; then if [[ "$_termius_custom_PS1" == "" || "$_termius_custom_PS1" != "$PS1" ]]; then _termius_original_PS1=$PS1; _termius_custom_PS1=$(_termius_wrap_prompt "$_termius_original_PS1"); PS1="$_termius_custom_PS1"; fi; _termius_in_command_execution="0"; fi; }; _termius_precmd() { if [ "$_termius_current_command" != "" ]; then _termius_command_exited "$_termius_status"; fi; _termius_current_cwd; _termius_current_command=""; _termius_update_prompt; }; _termius_preexec() { if [[ ! "$BASH_COMMAND" =~ ^_termius_prompt* ]]; then if [ "$_termius_history_verify" = "1" ]; then _termius_current_command="$(builtin history 1 | sed 's/ [0-9] *//')"; else _termius_current_command=$BASH_COMMAND; fi; else _termius_current_command=""; fi; if [ "$_termius_current_command" != "" ]; then _termius_command_started "$_termius_current_command"; fi; }; if [[ -n "${bash_preexec_imported:-}" ]]; then _termius_preexec_only() { if [ "$_termius_in_command_execution" = "0" ]; then _termius_in_command_execution="1"; _termius_preexec; fi; }; precmd_functions+=(_termius_prompt_cmd); preexec_functions+=(_termius_preexec_only); else _termius_dbg_trap="$(_termius_get_trap DEBUG)"; if [[ -z "$_termius_dbg_trap" ]]; then _termius_preexec_only() { if [ "$_termius_in_command_execution" = "0" ]; then _termius_in_command_execution="1"; _termius_preexec; fi; }; trap 'termius_preexec_only "$"' DEBUG; elif [[ "$_termius_dbg_trap" != 'termius_preexec "$"' && "$_termius_dbg_trap" != 'termius_preexec_all "$"' ]]; then _termius_preexec_all() { if [ "$_termius_in_command_execution" = "0" ]; then _termius_in_command_execution="1"; builtin eval "${_termius_dbg_trap}"; _termius_preexec; fi; }; trap 'termius_preexec_all "$"' DEBUG; fi; fi; _termius_update_prompt; _termius_restore_exit_code() { return "$1"; }; _termius_prompt_cmd_original() { _termius_status="$?"; _termius_restore_exit_code "${_termius_status}"; for cmd in "${_termius_original_prompt_command[@]}"; do eval "${cmd:-}"; done; _termius_precmd; }; _termius_prompt_cmd() { _termius_status="$?"; _termius_precmd; }; _termius_original_prompt_command=$PROMPT_COMMAND; if [[ -z "${bash_preexec_imported:-}" ]]; then if [[ -n "$_termius_original_prompt_command" && "$_termius_original_prompt_command" != "_termius_prompt_cmd" ]]; then PROMPT_COMMAND=_termius_prompt_cmd_original; else PROMPT_COMMAND=_termius_prompt_cmd; fi; fi; builtin printf "\e]4545;B\a"; fi

ttchess
asked 11 days ago121 views
1 Answer
0

The second command looks like a script that checks if Terminus is installed. This could perhaps run from your profile ~/.bash_profile or ~/.bashrc

See info here: https://support.termius.com/hc/en-us/articles/5300567592217-Integration-with-AWS

Have you installed Terminus or copied a profile to your instance that has the script in it?

Also, would be very wise to check your security group on the instance and verify that you are not opening port 22 for SSH to the internet (0.0.0.0/0).

Hope this helps!

profile pictureAWS
EXPERT
iBehr
answered 11 days ago
profile picture
EXPERT
reviewed 11 days 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