How to change root's shell back to bash?
up vote
5
down vote
favorite
I tried to change root's shell with chsh
command, but now I get an error when I try to connect as root with sudo -i
.
$ sudo -i
sudo: /usr/bin/bash: command not found
What do I have to modify to get the bash
shell?
command-line bash root chsh
add a comment |
up vote
5
down vote
favorite
I tried to change root's shell with chsh
command, but now I get an error when I try to connect as root with sudo -i
.
$ sudo -i
sudo: /usr/bin/bash: command not found
What do I have to modify to get the bash
shell?
command-line bash root chsh
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I tried to change root's shell with chsh
command, but now I get an error when I try to connect as root with sudo -i
.
$ sudo -i
sudo: /usr/bin/bash: command not found
What do I have to modify to get the bash
shell?
command-line bash root chsh
I tried to change root's shell with chsh
command, but now I get an error when I try to connect as root with sudo -i
.
$ sudo -i
sudo: /usr/bin/bash: command not found
What do I have to modify to get the bash
shell?
command-line bash root chsh
command-line bash root chsh
edited Nov 12 at 21:14
wjandrea
7,70642258
7,70642258
asked Nov 30 '16 at 3:28
Sandra Ross
3422416
3422416
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
12
down vote
accepted
Assuming that you have not modified the path or created symlink, the default path to the bash
binary is /bin/bash
, not /usr/bin/bash
.
The error is occurring because you have set the root
's shell as /usr/bin/bash
in /etc/passwd
like:
root:x:0:0:root:/root:/usr/bin/bash
You need to change that to /bin/bash
:
sudo usermod -s /bin/bash root
or do:
sudo vipw
and make the modifications manually.
You can obviously choose any other shell of your choice, just make sure that the path is correct. A common place to look for shell paths is /etc/shells
file which contains the full paths to all the valid login shells on the system.
Thanks for your answer. In the same time, I noticed I could modify the path withsudo emacs /etc/passwd
– Sandra Ross
Nov 30 '16 at 3:40
4
@SandraRoss If you are confident you can obviously do that. But i would suggestvipw
as it will do the sanity checkings (e.g. syntax) over the changes to make sure everything is in place.
– heemayl
Nov 30 '16 at 3:43
1
If you don't want to usse vipw, you can check the integrity of /etc/passwd with pwck
– ohno
Nov 30 '16 at 9:00
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
12
down vote
accepted
Assuming that you have not modified the path or created symlink, the default path to the bash
binary is /bin/bash
, not /usr/bin/bash
.
The error is occurring because you have set the root
's shell as /usr/bin/bash
in /etc/passwd
like:
root:x:0:0:root:/root:/usr/bin/bash
You need to change that to /bin/bash
:
sudo usermod -s /bin/bash root
or do:
sudo vipw
and make the modifications manually.
You can obviously choose any other shell of your choice, just make sure that the path is correct. A common place to look for shell paths is /etc/shells
file which contains the full paths to all the valid login shells on the system.
Thanks for your answer. In the same time, I noticed I could modify the path withsudo emacs /etc/passwd
– Sandra Ross
Nov 30 '16 at 3:40
4
@SandraRoss If you are confident you can obviously do that. But i would suggestvipw
as it will do the sanity checkings (e.g. syntax) over the changes to make sure everything is in place.
– heemayl
Nov 30 '16 at 3:43
1
If you don't want to usse vipw, you can check the integrity of /etc/passwd with pwck
– ohno
Nov 30 '16 at 9:00
add a comment |
up vote
12
down vote
accepted
Assuming that you have not modified the path or created symlink, the default path to the bash
binary is /bin/bash
, not /usr/bin/bash
.
The error is occurring because you have set the root
's shell as /usr/bin/bash
in /etc/passwd
like:
root:x:0:0:root:/root:/usr/bin/bash
You need to change that to /bin/bash
:
sudo usermod -s /bin/bash root
or do:
sudo vipw
and make the modifications manually.
You can obviously choose any other shell of your choice, just make sure that the path is correct. A common place to look for shell paths is /etc/shells
file which contains the full paths to all the valid login shells on the system.
Thanks for your answer. In the same time, I noticed I could modify the path withsudo emacs /etc/passwd
– Sandra Ross
Nov 30 '16 at 3:40
4
@SandraRoss If you are confident you can obviously do that. But i would suggestvipw
as it will do the sanity checkings (e.g. syntax) over the changes to make sure everything is in place.
– heemayl
Nov 30 '16 at 3:43
1
If you don't want to usse vipw, you can check the integrity of /etc/passwd with pwck
– ohno
Nov 30 '16 at 9:00
add a comment |
up vote
12
down vote
accepted
up vote
12
down vote
accepted
Assuming that you have not modified the path or created symlink, the default path to the bash
binary is /bin/bash
, not /usr/bin/bash
.
The error is occurring because you have set the root
's shell as /usr/bin/bash
in /etc/passwd
like:
root:x:0:0:root:/root:/usr/bin/bash
You need to change that to /bin/bash
:
sudo usermod -s /bin/bash root
or do:
sudo vipw
and make the modifications manually.
You can obviously choose any other shell of your choice, just make sure that the path is correct. A common place to look for shell paths is /etc/shells
file which contains the full paths to all the valid login shells on the system.
Assuming that you have not modified the path or created symlink, the default path to the bash
binary is /bin/bash
, not /usr/bin/bash
.
The error is occurring because you have set the root
's shell as /usr/bin/bash
in /etc/passwd
like:
root:x:0:0:root:/root:/usr/bin/bash
You need to change that to /bin/bash
:
sudo usermod -s /bin/bash root
or do:
sudo vipw
and make the modifications manually.
You can obviously choose any other shell of your choice, just make sure that the path is correct. A common place to look for shell paths is /etc/shells
file which contains the full paths to all the valid login shells on the system.
edited Dec 2 '16 at 2:32
wjandrea
7,70642258
7,70642258
answered Nov 30 '16 at 3:36
heemayl
65.2k8134208
65.2k8134208
Thanks for your answer. In the same time, I noticed I could modify the path withsudo emacs /etc/passwd
– Sandra Ross
Nov 30 '16 at 3:40
4
@SandraRoss If you are confident you can obviously do that. But i would suggestvipw
as it will do the sanity checkings (e.g. syntax) over the changes to make sure everything is in place.
– heemayl
Nov 30 '16 at 3:43
1
If you don't want to usse vipw, you can check the integrity of /etc/passwd with pwck
– ohno
Nov 30 '16 at 9:00
add a comment |
Thanks for your answer. In the same time, I noticed I could modify the path withsudo emacs /etc/passwd
– Sandra Ross
Nov 30 '16 at 3:40
4
@SandraRoss If you are confident you can obviously do that. But i would suggestvipw
as it will do the sanity checkings (e.g. syntax) over the changes to make sure everything is in place.
– heemayl
Nov 30 '16 at 3:43
1
If you don't want to usse vipw, you can check the integrity of /etc/passwd with pwck
– ohno
Nov 30 '16 at 9:00
Thanks for your answer. In the same time, I noticed I could modify the path with
sudo emacs /etc/passwd
– Sandra Ross
Nov 30 '16 at 3:40
Thanks for your answer. In the same time, I noticed I could modify the path with
sudo emacs /etc/passwd
– Sandra Ross
Nov 30 '16 at 3:40
4
4
@SandraRoss If you are confident you can obviously do that. But i would suggest
vipw
as it will do the sanity checkings (e.g. syntax) over the changes to make sure everything is in place.– heemayl
Nov 30 '16 at 3:43
@SandraRoss If you are confident you can obviously do that. But i would suggest
vipw
as it will do the sanity checkings (e.g. syntax) over the changes to make sure everything is in place.– heemayl
Nov 30 '16 at 3:43
1
1
If you don't want to usse vipw, you can check the integrity of /etc/passwd with pwck
– ohno
Nov 30 '16 at 9:00
If you don't want to usse vipw, you can check the integrity of /etc/passwd with pwck
– ohno
Nov 30 '16 at 9:00
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f855211%2fhow-to-change-roots-shell-back-to-bash%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown