Centos5 executes the host prompt command not found solution

Time:2021-10-20

When – bash: host: command not found is displayed, we need to install the corresponding package

The host program is in the bind utils package

terms of settlement

So install bind utils first

Copy code

The code is as follows:

yum install bind-utils

summary

Many default packages will not be installed, so you must first understand the basic knowledge of relevant packages before installation.

CentOS prompts command not found, perhaps because of permission problems

Log in to CentOS 5.4 through SSH and switch to the root account. I found many command prompts command not found. Today I found out what happened. Hey, it seems that I need to learn from the basics step by step. The knowledge points involve user permissions and user switching.
Joe is an ordinary user and root is a super user.

The phenomena are as follows:
[[email protected] ~]$ su
Password:
[[email protected] joe]# ifconfig
bash: ifconfig: command not found

Su command format
su [-|-p] [-c command] [username]
-: switch the user’s working environment when switching the current user
-P: do not switch the user’s working environment when switching the current user, that is, keep the current user’s working environment. This is the default value
-C command: execute the command com m and as the specified user
Username: the user to be switched. If omitted, it means root

The difference between Su and Su – is why.
#Switch to super user without switching user identity
[[email protected] joe]# su
Password:
[[email protected] joe]# env|egrep ‘USER|LOGNAME|PATH|MAIL’
USER=joe
MAIL=/var/spool/mail/joe
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/joe/bin
LOGNAME=joe

#Switch to super user root and switch user identity at the same time
[[email protected] joe]# su –
Password:
[[email protected] ~]# env | egrep ‘USER|LOGNAME|PATH|MAIL’
USER=root
MAIL=/var/spool/mail/root
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
LOGNAME=root
[[email protected] ~]#

The Su – command switches to the root environment
[[email protected] ~]$ su –
Password:
[[email protected] ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:60:9D:F1:A8
inet addr:192.168.6.55 Bcast:255.255.255.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:69028 errors:0 dropped:0 overruns:0 frame:0
TX packets:39738 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:102040430 (97.3 MiB) TX bytes:3030863 (2.8 MiB)
Interrupt:169 Memory:e0500000-e0510000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[[email protected] ~]#

The knowledge of user rights needs to be learned, ha ha

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress:https://github.com/nino-laiqiu/TiTanI recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]