View previous topic :: View next topic |
Author |
Message |
pgu l33t
Joined: 30 Jul 2009 Posts: 722 Location: Oslo, Norway
|
Posted: Sun Jan 11, 2015 9:03 pm Post subject: Changing the shell for root from git-shell |
|
|
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
Code: | $ 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. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Sun Jan 11, 2015 9:06 pm Post subject: |
|
|
What happens if you just do su not su - _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 722 Location: Oslo, Norway
|
Posted: Sun Jan 11, 2015 9:21 pm Post subject: |
|
|
Same thing. I just get the message from git-shell
Code: | fatal: Interactive git shell is not enabled. |
|
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Sun Jan 11, 2015 9:26 pm Post subject: |
|
|
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 _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23082
|
Posted: Sun Jan 11, 2015 9:26 pm Post subject: |
|
|
From an existing root shell, chsh root. Otherwise, use the rescue media. |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 722 Location: Oslo, Norway
|
Posted: Sun Jan 11, 2015 9:32 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Sun Jan 11, 2015 10:36 pm Post subject: |
|
|
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 _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 722 Location: Oslo, Norway
|
Posted: Tue Jan 13, 2015 3:11 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
|