Unable to login the VM usng below CLI command | error - debug1: Exit status 127

suresh Reddy 41 Reputation points
2023-03-18T06:48:52.8766667+00:00

When login into the VM using could shell with the below command got the error

az ssh vm -n <vm-name>1 -g <resource-group> --debug from CLI.

Error : debug1: Exit status 127

debug1: Remote: principals: user@abc.com
debug3: receive packet: type 4
debug1: Remote: principals:  user@abc.com
debug3: receive packet: type 91
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x08
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug3: Ignored env AZ_INSTALLER
debug3: Ignored env PYTHONPATH
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env HOSTNAME
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env HISTSIZE
debug3: Ignored env USER
debug3: Ignored env rg
debug3: Ignored env LS_COLORS
debug3: Ignored env PATH
debug3: Ignored env MAIL
debug3: Ignored env PWD
debug3: Ignored env LOCKFILE_DIR
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env HISTCONTROL
debug3: Ignored env HOME
debug3: Ignored env SHLVL
debug3: Ignored env vm
debug3: Ignored env LOGNAME
debug3: Ignored env LESSOPEN
debug3: Ignored env _
debug1: Sending command: 1
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
debug2: channel 0: rcvd ext data 27
bash: 1: command not found
debug2: channel 0: written 27 to efd 6
debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)
 
debug3: send packet: type 1
Transferred: sent 5128, received 3960 bytes, in 8.1 seconds
Bytes per second: sent 635.0, received 490.3
debug1: Exit status 127
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x7fd988397d08>, <function _x509_from_base64_to_hex_transform at 0x7fd988397d90>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fd988854400>]
az_command_data_logger: exit code: 0
cli.__main__: Command ran in 40.152 seconds (init: 0.167, invoke: 39.985)
telemetry.save: Save telemetry record of length 3963 in cache
telemetry.check: Negative: The /root/.azure/telemetry.txt was modified at 2023-03-15 11:19:23.243248, which in less than 600.000000 s

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
632 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,065 questions
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 23,856 Reputation points Microsoft Employee
    2023-03-27T04:47:53.2866667+00:00

    Hello suresh Reddy

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    The error message "bash: 1: command not found" suggests that the command you are trying to execute on the VM is not found.

    Please check the command once and make sure it is correct. You can try logging in to the VM using another method, such as using an SSH client like PuTTY or the Azure portal's "Connect" button, to see if the issue is specific to the CLI command you are using.

    Please check this document once and try again:
    https://learn.microsoft.com/en-us/azure/cloud-shell/quickstart?tabs=azurecli

    Share the command that you are trying, will try once and see if I am able to reproduce the error.

    Hope this helps.

    0 comments No comments