In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to switch between linux shell. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
Switching of linux shell
If you need to modify the default shell (usually bash shell) to make it easy to use.
Check the types of shell available to the system first
[oracle@zeng ~] $chsh-l
/ bin/sh
/ bin/bash
/ sbin/nologin
/ bin/tcsh
/ bin/csh
/ bin/ksh
Modify the current shell
[oracle@zeng ~] $chsh
Changing shell for oracle.
Password:
New shell [/ bin/bash]: / bin/ksh
Shell changed.
The shell currently available to the system exists in the / etc/shells file.
[oracle@zeng ~] $cat / etc/shells
/ bin/sh / / shell used on earlier versions of unix.
/ bin/bash / / the default shell for many linux versions, also known as bash shell.
/ sbin/nologin / / you cannot use bash shell or other shell to log in to the system.
/ bin/tcsh / / enhanced version of csh.
/ bin/csh / / the popular shell type on the older version of unix, similar to the c language.
The popular shell type on / bin/ksh / / unix is fully compatible with Bourne Unix shell and absorbs many of the features of csh.
The result of cat / etc/shells is consistent with that of chsh-l. However, it is recommended to use bash shell because it is robust enough and absorbs the useful features of ksh,csh,sh.
Shell changes need to be logged out and will not be valid until the next time you log in to the system.
Here I've changed ksh to bash sh again, and now look at the default login shell.
[oracle@zeng ~] $cat / etc/passwd | grep-I oracle
Oracle:x:501:501::/home/oracle:/bin/bash
For that / sbin/nologin, a look at / etc/passwd shows that there are many such accounts for services in the system, and that these accounts cannot be logged in is a protection for system security.
For example, try to use the apache account to log in to the system.
[root@zeng ~] # su-apache
This account is currently not available.
You can create a new file / etc/nologin.txt to indicate the reason for the information that cannot be logged in.
[root@zeng ~] # vi / etc/nologin.txt / / write the following paragraph
This is a system account,you don't allow login with it!
[root@zeng ~] # su-apache
This is a system account,you don't allow login with it!
After reading the above, do you have any further understanding of how to switch linux shell? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.