# Changing the shell for root from git-shell

## pgu

I accidentally changed the root shell to git-shell. Is there a way to change it back? I can su to root, but I don't have sudo access. I tried

```
$ su -s /bin/bash -m - 
```

But it seems like it will run git-shell before running the supplied shell. Is there a way to change the shell using su?

If not I'll have to boot from resuce media and change the shell in /etc/passwd.

----------

## Naib

What happens if you just do su not su -

----------

## pgu

Same thing. I just get the message from git-shell

```
fatal: Interactive git shell is not enabled.
```

----------

## Naib

Looks like a reboot.

You don't need a rescue CD and all that.

Just boot, press 'e' to edit the boot command and add 'init=/bin/bash'

And let it boot. Then just nano /etc/passwd

----------

## Hu

From an existing root shell, chsh root.  Otherwise, use the rescue media.

----------

## pgu

I don't have an existing root shell and I don't have access to the console. I can boot from different media over the network though, but it's a bit of a hassle.

----------

## Naib

as I said, you don't need to boot from another medium, at teh GRUB screen just amend the kernel command to pass init=/bin/bash and you will boot directly to a bash prompt, from which you can edit /etc/passwd

----------

## pgu

Thanks. I'm aware of the grub option, but as I said I don't have console access. Hence I can't supply parameters to grub. I managed to boot from a rescue image and mounted the partition and changed the shell.

----------

