# How to change the default Shell or Terminal Type

**URL:** <https://forum.ansible.com/t/how-to-change-the-default-shell-or-terminal-type/35586>\
**Category:** Ansible Project\
**Created:** [August 4, 2021, 11:23pm UTC](https://forum.ansible.com/t/how-to-change-the-default-shell-or-terminal-type/35586 "2021-08-04T23:23:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nagaraju\_chappa](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@Nagaraju\_chappa](https://forum.ansible.com/u/Nagaraju_chappa)\
**Post date:** [August 4, 2021, 11:23pm UTC](https://forum.ansible.com/t/how-to-change-the-default-shell-or-terminal-type/35586/1 "2021-08-04T23:23:24Z")

</div>

Hi Team ,

When I am running an Ansible Playbook on an host it works fine with the root user , but when I tried with different user it is timing out . It seems the ksh shell profile is looking for terminal type for that user .Since I am not passing from playbook it is timing out .  
For the same user , it works fine when I change the default shell to bash on the host .

My question here is ,

1. is there a way programmatically can change the default shell to /bin/bash from playbook?

I tried using environmental variable , but it didn’t work.  
or

1. Is there a way to pass the terminal type ?

Thanks for your help in advance .

Thanks,  
Nagaraju

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 5, 2021, 4:44am UTC](https://forum.ansible.com/t/how-to-change-the-default-shell-or-terminal-type/35586/2 "2021-08-05T04:44:25Z")

</div>

What exactly is timing out? At what stage?  
Either way, this looks like it’s not something to fix from within ansible.  
I would use the ‘env’ command to find out exactly what you need.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [August 5, 2021, 2:55pm UTC](https://forum.ansible.com/t/how-to-change-the-default-shell-or-terminal-type/35586/3 "2021-08-05T14:55:09Z")

</div>

By default ansible uses /bin/sh (which POSIX systems are required to  
have), changing the shell is non trivial and has many consequences.  
That said, use the `ansible_shell_type` variable, but must be to a  
matching existing shell plugin (there is no bash but there is an sh  
one).
