您好,登錄后才能下訂單哦!
在unix里沒有sudo的環(huán)境,需要先安裝sudo,在配置sudo,
我這個(gè)是自己的環(huán)境,各位配合自己的環(huán)境使用哦
1,檢查sudo是否安裝,如果安裝直接配置就可以。
2,下載sudo,或者是用ftp
3,安裝sudo
4,配置sudo
。。。。。。。在安裝中是用源碼安裝的,一定要編譯好,要不然找不到配置文件。下面的網(wǎng)址結(jié)合看會(huì)更明白。
安裝和配置sudo :http://linux.chinaunix.net/techdoc/install/2006/03/05/928431.shtml
1、輸入sudo命令測(cè)試此linux系統(tǒng)是否安裝了sudo工具,如果安裝,直接編輯配置文件
# sudo ------------------看一下是否安裝了sudo
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
[-u username/#uid] -s | <command>-----------------------------------------如果安裝,直接編輯配置文件
2、下載sudo
cs_svr17[/tmp]#cd /tmp---------------------------------進(jìn)入/tmp目錄下
cs_svr17[/tmp]#pwd------------------------------------確認(rèn)是tmp目錄
/tmp
cs_svr17[/tmp]#ftp 218.206.191.9 --------------------ftp地址
Connected to 218.206.191.9.
220 (vsFTPd 2.2.2)
Name (218.206.191.9:szcare): sheng2----------------輸入用戶名sheng2
331 Please specify the password. ------------------------輸入密碼ENGsh%029
Password:-----------------------------------密碼錯(cuò)誤
530 Login incorrect.
Login failed.
ftp> by ----
221 Goodbye.
cs_svr17[/tmp]#ftp 218.206.191.9 ----------------------------從新輸入
Connected to 218.206.191.9.
220 (vsFTPd 2.2.2)
Name (218.206.191.9:szcare): sheng2---------------------輸入用戶名
331 Please specify the password.---------------------------------輸入密碼
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd chaijx/omc---------------------------------------------------進(jìn)入放ftp的目錄
250 Directory successfully changed.
ftp> ls-------------------------------------------------------------------查看文件內(nèi)容,沒有我們要的包輸入bin轉(zhuǎn)換成2進(jìn)制
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-rw-r-- 1 605 600 154679 May 31 11:28 oam-system-config.xml
-rw-rw-r-- 1 605 600 1648640 May 31 12:16 sudo-1.6.7p5.tar
-rw-rw-r-- 1 605 600 1013760 May 31 12:16 sudo-1.6.9p17-ia64-11.23.depot.gz
-rw-rw-r-- 1 605 600 525861 May 31 12:16 sudo-1.7.1-ia64-11.23.depot.gz
-rw-rw-r-- 1 605 600 1858612 May 31 12:16 sudo-1.8.6p8.tar.gz
226 Directory send OK.
ftp> bin----------------------轉(zhuǎn)換成2進(jìn)制后下載需要的包
200 Switching to Binary mode.
ftp> get sudo-1.6.7p5.tar ------------------------------------------------下載sudo包
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for sudo-1.6.7p5.tar (1648640 bytes).
226 Transfer complete.
1648640 bytes received in 0.19 seconds (8309.33 Kbytes/s)
ftp> mget sudo* -----------------------------------------------下載全部的sudo包一直按Y
mget sudo-1.6.7p5.tar? y
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for sudo-1.6.7p5.tar (1648640 bytes).
226 Transfer complete.
1648640 bytes received in 0.20 seconds (8113.32 Kbytes/s)
mget sudo-1.6.9p17-ia64-11.23.depot.gz? y
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for sudo-1.6.9p17-ia64-11.23.depot.gz (1013760 bytes).
226 Transfer complete.
1013760 bytes received in 0.11 seconds (9062.70 Kbytes/s)
mget sudo-1.7.1-ia64-11.23.depot.gz? y
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for sudo-1.7.1-ia64-11.23.depot.gz (525861 bytes).
226 Transfer complete.
525861 bytes received in 0.06 seconds (7937.68 Kbytes/s)
mget sudo-1.8.6p8.tar.gz? y
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for sudo-1.8.6p8.tar.gz (1858612 bytes).
226 Transfer complete.
1858612 bytes received in 0.23 seconds (7847.07 Kbytes/s)
ftp> by
221 Goodbye.
cs_svr17[/tmp]#ls
.AgentSockets start_daf.txt
.kc.trace start_daf_err.log
.s.PGSQL.10864 start_daf_tmp.txt
.s.PGSQL.10864.lock start_serv.log
X11_newfonts.log start_serv.txt
hpce start_serv_err.log
install.vars start_serv_tmp.txt
ipv6agt.crashlog stop_daf.log
krun.1541 stop_daf.txt
llbdbase.dat stop_serv.log
lost+found stop_serv.txt
ncweb_apa.log sudo-1.6.7p5.tar
ncweb_iether.log sudo-1.6.9p17-ia64-11.23.depot.gz
portmap.file sudo-1.7.1-ia64-11.23.depot.gz
rpcbind.file sudo-1.8.6p8.tar.gz
sd_ipd_acl.2727 swlist
start_daf.log zabbix_agentd.pid
cs_svr17[/tmp]#
3、安裝sudo
# tar -xvf sudo-1.6.7p5.tar ------------解壓sudo
# cd /tmp/sudo-1.6.7p5
# ./configure --prefix=/usr/local/sudo --bindir=/usr/bin --sbindir=/usr/sbin --mandir=/usr/share/man --sysconf=/etc ------------------編譯sudo,visudo,man的配置文件
# make
# make installn
4、編輯配置文件
進(jìn)入/etc修改/sudoers配置文件
cs_svr17[/]#cd /etc ------------進(jìn)入/etc
cs_svr17[/etc]#pwd
/etc
cs_svr17[/etc]#ll sudo*--------------查看sudo的文件,找到sudoers
-r--r----- 1 root root 580 May 31 20:39 sudoers
cs_svr17[/etc]#cat sudoers------------查看sudoers
我是直接執(zhí)行visudo的命令
#visudo
軟件從源碼包安裝過程:
./configure #編譯sudo軟件
make#執(zhí)行編譯sudo軟件
make install#安裝編譯sudo軟件
export PATH=$PATH:/usr/local/bin:/usr/local/sbin #修改可執(zhí)行文件的查找路徑
which sudo#查找可執(zhí)行軟件所在位置
sudo --help -------------檢查sudo已經(jīng)安裝
export PATH=$PATH:/usr/local/bin:/usr/local/sbin----如果沒有編譯,就需要零時(shí)添加變量到 profile
或者是永久添加變量# vi /etc/profile
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。