Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Changing the shell for root from git-shell
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun Jan 11, 2015 9:03 pm    Post subject: Changing the shell for root from git-shell Reply with quote

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
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5713
Location: Removed by Neddy

PostPosted: Sun Jan 11, 2015 9:06 pm    Post subject: Reply with quote

What happens if you just do su not su -
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun Jan 11, 2015 9:21 pm    Post subject: Reply with quote

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

Code:
fatal: Interactive git shell is not enabled.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5713
Location: Removed by Neddy

PostPosted: Sun Jan 11, 2015 9:26 pm    Post subject: Reply with quote

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
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14400

PostPosted: Sun Jan 11, 2015 9:26 pm    Post subject: Reply with quote

From an existing root shell, chsh root. Otherwise, use the rescue media.
Back to top
View user's profile Send private message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun Jan 11, 2015 9:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5713
Location: Removed by Neddy

PostPosted: Sun Jan 11, 2015 10:36 pm    Post subject: Reply with quote

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
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Tue Jan 13, 2015 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum