How can I change the Session Manager shell to bash on EC2 Linux instances?
I want to change the Session Manager default shell on my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance. How can I do that?
"I want to change the Session Manager default shell on my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance. How can I do that?Short descriptionSession Manager sessions on Amazon EC2 Linux instances use the Bourne shell (sh) by default. However, bash is the default shell in major Linux distributions. If you’re more comfortable using bash than sh, you can change the default Session Manager shell to bash using configurable shell profiles. Shell profiles allow you to customize preferences within sessions when you use Session Manager, including:Shell preferencesEnvironment variablesWorking directoriesRunning multiple commands when a session startsYou can enable configurable shell profiles using the Systems Manager console or the AWS Command Line Interface (AWS CLI).ResolutionPrerequisitesTo enable shell profiles, you must use SSM Agent version 3.0.196.0 or later. Check the SSM Agent version number on your instance. If necessary, update SSM Agent. For more information, see Automating updates to SSM Agent.To see the available shells on the instance, run the following command:$ sudo cat /etc/shellsNote: You can use any of the shells returned using this command.Enable configurable shell profiles (console)To enable configurable shell profiles and change the shell to bash using the Systems Manager console, follow these steps:1.    Open the Systems manager console, and then choose Session Manager from the navigation pane.2.    Choose the Preferences tab, and then choose Edit.3.    For "linux" under "shellProfile", enter the following:/bin/bash4.    Choose Save.Enable configurable shell profiles (AWS CLI)Note: If you receive errors when running AWS CLI commands, make sure that you're using the most recent version of the AWS CLI.For instructions to enable configurable shell profiles and change the shell to bash using the AWS CLI, see Create Session Manager preferences (command line).Other shell profile configuration optionsBy default, Session Manager starts in the “/usr/bin” directory. You can add a command to your shell profile to change the /usr directory on Linux instances. For example:cd /home/ec2-userYou can also use the shell profile to load specific environment variables, or to run a script at the start of the session. For example, to add the PYTHONPATH environment variable, add the following command to your shell profile:export PYTHONPATH=/usr/lib/python2.7When you are logged in, you can run the following command to verify that the environment variable is correctly set:$ sudo envRelated informationEnable configurable shell profilesGrant or deny user permissions to update Session Manager preferencesSpecify an idle session timeout valueFollow"