âsu userâ does not work on CentOS 7

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a new CentOS server.
This is server uname info:

[root@server ~]# uname -vr
3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018
[root@server ~]#
When I try to change user using the su command, nothing happens after running the command:

[root@server ~]# su ks1
[root@server ~]#
I did add my user to wheel but that didn't affect the result!
As Mentioned in Comments
[root@server ~]# getent passwd ks1
ks1:x:1004:1006::/home/ks1:/bin/false
Do you what the problem is?
centos su
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
I have a new CentOS server.
This is server uname info:

[root@server ~]# uname -vr
3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018
[root@server ~]#
When I try to change user using the su command, nothing happens after running the command:

[root@server ~]# su ks1
[root@server ~]#
I did add my user to wheel but that didn't affect the result!
As Mentioned in Comments
[root@server ~]# getent passwd ks1
ks1:x:1004:1006::/home/ks1:/bin/false
Do you what the problem is?
centos su
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
does the target user have a valid shell?getent passwd ksl(orks1, I can't tell from the graphic)
â Jeff Schaller
1 hour ago
2
Please do not paste screenshots but rather copy text from terminal
â mrc02_kr
1 hour ago
1
ks1does not have a valid shell. There shell is/bin/false@Jeff add that as an answer. You need to set there shell.
â ctrl-alt-delor
39 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a new CentOS server.
This is server uname info:

[root@server ~]# uname -vr
3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018
[root@server ~]#
When I try to change user using the su command, nothing happens after running the command:

[root@server ~]# su ks1
[root@server ~]#
I did add my user to wheel but that didn't affect the result!
As Mentioned in Comments
[root@server ~]# getent passwd ks1
ks1:x:1004:1006::/home/ks1:/bin/false
Do you what the problem is?
centos su
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have a new CentOS server.
This is server uname info:

[root@server ~]# uname -vr
3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018
[root@server ~]#
When I try to change user using the su command, nothing happens after running the command:

[root@server ~]# su ks1
[root@server ~]#
I did add my user to wheel but that didn't affect the result!
As Mentioned in Comments
[root@server ~]# getent passwd ks1
ks1:x:1004:1006::/home/ks1:/bin/false
Do you what the problem is?
centos su
centos su
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 29 mins ago
Jeff Schaller
33.9k851113
33.9k851113
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 1 hour ago
Kiyarash
1085
1085
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Kiyarash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
does the target user have a valid shell?getent passwd ksl(orks1, I can't tell from the graphic)
â Jeff Schaller
1 hour ago
2
Please do not paste screenshots but rather copy text from terminal
â mrc02_kr
1 hour ago
1
ks1does not have a valid shell. There shell is/bin/false@Jeff add that as an answer. You need to set there shell.
â ctrl-alt-delor
39 mins ago
add a comment |Â
2
does the target user have a valid shell?getent passwd ksl(orks1, I can't tell from the graphic)
â Jeff Schaller
1 hour ago
2
Please do not paste screenshots but rather copy text from terminal
â mrc02_kr
1 hour ago
1
ks1does not have a valid shell. There shell is/bin/false@Jeff add that as an answer. You need to set there shell.
â ctrl-alt-delor
39 mins ago
2
2
does the target user have a valid shell?
getent passwd ksl (or ks1, I can't tell from the graphic)â Jeff Schaller
1 hour ago
does the target user have a valid shell?
getent passwd ksl (or ks1, I can't tell from the graphic)â Jeff Schaller
1 hour ago
2
2
Please do not paste screenshots but rather copy text from terminal
â mrc02_kr
1 hour ago
Please do not paste screenshots but rather copy text from terminal
â mrc02_kr
1 hour ago
1
1
ks1 does not have a valid shell. There shell is /bin/false @Jeff add that as an answer. You need to set there shell.â ctrl-alt-delor
39 mins ago
ks1 does not have a valid shell. There shell is /bin/false @Jeff add that as an answer. You need to set there shell.â ctrl-alt-delor
39 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
In order to switch user to another user, you need a shell. The shell for su is specified in the following order:
- the shell specified with --shell
- The shell specified in the environment variable SHELL if the --preserve-environment option is used.
- the shell listed in the passwd entry of the target user
- /bin/sh
Since you did not specify a --shell or --preserve-environment option, and the user had a shell listed, su executed that shell, which immediately exited.
Try, instead, setting a valid shell on the user, or specifying a shell with --shell.
su --shell /bin/bash ks1
# or
chsh -s /bin/bash ks1
su ks1
That was the problem. I'm newbie, thanks for your help
â Kiyarash
31 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
In order to switch user to another user, you need a shell. The shell for su is specified in the following order:
- the shell specified with --shell
- The shell specified in the environment variable SHELL if the --preserve-environment option is used.
- the shell listed in the passwd entry of the target user
- /bin/sh
Since you did not specify a --shell or --preserve-environment option, and the user had a shell listed, su executed that shell, which immediately exited.
Try, instead, setting a valid shell on the user, or specifying a shell with --shell.
su --shell /bin/bash ks1
# or
chsh -s /bin/bash ks1
su ks1
That was the problem. I'm newbie, thanks for your help
â Kiyarash
31 mins ago
add a comment |Â
up vote
1
down vote
accepted
In order to switch user to another user, you need a shell. The shell for su is specified in the following order:
- the shell specified with --shell
- The shell specified in the environment variable SHELL if the --preserve-environment option is used.
- the shell listed in the passwd entry of the target user
- /bin/sh
Since you did not specify a --shell or --preserve-environment option, and the user had a shell listed, su executed that shell, which immediately exited.
Try, instead, setting a valid shell on the user, or specifying a shell with --shell.
su --shell /bin/bash ks1
# or
chsh -s /bin/bash ks1
su ks1
That was the problem. I'm newbie, thanks for your help
â Kiyarash
31 mins ago
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
In order to switch user to another user, you need a shell. The shell for su is specified in the following order:
- the shell specified with --shell
- The shell specified in the environment variable SHELL if the --preserve-environment option is used.
- the shell listed in the passwd entry of the target user
- /bin/sh
Since you did not specify a --shell or --preserve-environment option, and the user had a shell listed, su executed that shell, which immediately exited.
Try, instead, setting a valid shell on the user, or specifying a shell with --shell.
su --shell /bin/bash ks1
# or
chsh -s /bin/bash ks1
su ks1
In order to switch user to another user, you need a shell. The shell for su is specified in the following order:
- the shell specified with --shell
- The shell specified in the environment variable SHELL if the --preserve-environment option is used.
- the shell listed in the passwd entry of the target user
- /bin/sh
Since you did not specify a --shell or --preserve-environment option, and the user had a shell listed, su executed that shell, which immediately exited.
Try, instead, setting a valid shell on the user, or specifying a shell with --shell.
su --shell /bin/bash ks1
# or
chsh -s /bin/bash ks1
su ks1
answered 35 mins ago
Jeff Schaller
33.9k851113
33.9k851113
That was the problem. I'm newbie, thanks for your help
â Kiyarash
31 mins ago
add a comment |Â
That was the problem. I'm newbie, thanks for your help
â Kiyarash
31 mins ago
That was the problem. I'm newbie, thanks for your help
â Kiyarash
31 mins ago
That was the problem. I'm newbie, thanks for your help
â Kiyarash
31 mins ago
add a comment |Â
Kiyarash is a new contributor. Be nice, and check out our Code of Conduct.
Kiyarash is a new contributor. Be nice, and check out our Code of Conduct.
Kiyarash is a new contributor. Be nice, and check out our Code of Conduct.
Kiyarash is a new contributor. Be nice, and check out our Code of Conduct.
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475123%2fsu-user-does-not-work-on-centos-7%23new-answer', 'question_page');
);
Post as a guest
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
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
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
2
does the target user have a valid shell?
getent passwd ksl(orks1, I can't tell from the graphic)â Jeff Schaller
1 hour ago
2
Please do not paste screenshots but rather copy text from terminal
â mrc02_kr
1 hour ago
1
ks1does not have a valid shell. There shell is/bin/false@Jeff add that as an answer. You need to set there shell.â ctrl-alt-delor
39 mins ago