亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
12下一頁
最近訪問板塊 發(fā)新帖
查看: 3865 | 回復(fù): 10
打印 上一主題 下一主題

[系統(tǒng)安裝] RHEL中sudo的問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2013-05-31 13:19 |只看該作者 |倒序瀏覽
    在學(xué)習(xí)Linux系統(tǒng)過程中(我是依據(jù)鳥哥私房菜)看到默認情況下下sudo命令只能對root用戶有用?墒俏以跊]有修改任何配置文件的情況下普通用戶也可以使用sudo命令的,不知道是什么原因?qū)е碌,還忘群內(nèi)高手給予釋疑,謝謝。
   系統(tǒng)為RHEL 6.2 ,內(nèi)核為:2.6.32-220.el6.i686

/etc/sudoers的默認配置文件:

## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.

## Host Aliases
## Groups of machines. You may prefer to use hostnames (perhaps using
## wildcards for entire domains) or IP addresses instead.
# Host_Alias     FILESERVERS = fs1, fs2
# Host_Alias     MAILSERVERS = smtp, smtp2

## User Aliases
## These aren't often necessary, as you can use regular groups
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
## rather than USERALIAS
# User_Alias ADMINS = jsmith, mikem


## Command Aliases
## These are groups of related commands...

## Networking
# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool

## Installation and management of software
# Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

## Services
# Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig

## Updating the locate database
# Cmnd_Alias LOCATE = /usr/bin/updatedb

## Storage
# Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount

## Delegating permissions
# Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp

## Processes
# Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

## Drivers
# Cmnd_Alias DRIVERS = /sbin/modprobe

# Defaults specification

#
# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
#         You have to run "ssh -t hostname sudo <cmd>".
#
Defaults    requiretty

#
# Refuse to run if unable to disable echo on the tty. This setting should also be
# changed in order to be able to use sudo without a tty. See requiretty above.
#
Defaults   !visiblepw

#
# Preserving HOME has security implications since many programs
# use it when searching for configuration files.
#
Defaults    always_set_home

Defaults    env_reset
Defaults    env_keep =  "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
Defaults    env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"

#
# Adding HOME to env_keep may enable a user to run unrestricted
# commands via sudo.
#
# Defaults   env_keep += "HOME"

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin

## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
##         user        MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root        ALL=(ALL)         ALL

## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)        ALL

## Same thing without a password
# %wheel        ALL=(ALL)        NOPASSWD: ALL

## Allows members of the users group to mount and unmount the
## cdrom as root
# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

## Allows members of the users group to shutdown this system
# %users  localhost=/sbin/shutdown -h now

## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d

謝謝!

論壇徽章:
3
水瓶座
日期:2014-03-25 17:08:042015亞冠之塔什干棉農(nóng)
日期:2015-08-10 10:45:122015亞冠之薩濟拖拉機
日期:2015-08-13 16:05:24
2 [報告]
發(fā)表于 2013-05-31 13:24 |只看該作者
只有這一行root        ALL=(ALL)         ALL,沒有其他的了,其他用戶應(yīng)該都用不了sudo,如果執(zhí)行sudo的話,會提示 user not in sudoer list的。

論壇徽章:
381
CU十二周年紀念徽章
日期:2014-01-04 22:46:58CU大;照
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大;照
日期:2013-04-17 11:17:47CU大;照
日期:2013-04-17 11:17:52CU大;照
日期:2013-04-17 11:17:56
3 [報告]
發(fā)表于 2013-05-31 13:31 |只看該作者
沒有配置sudo,應(yīng)該是不行的.
樓主將命令運行的結(jié)果貼一下

論壇徽章:
2
數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2015-08-04 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2015-08-28 06:20:00
4 [報告]
發(fā)表于 2013-05-31 13:35 |只看該作者
你執(zhí)行sudo命令時帶參數(shù)了嗎?

論壇徽章:
0
5 [報告]
發(fā)表于 2013-05-31 13:51 |只看該作者
謝謝各位的解答,由于我的粗心大意才給大家?guī)磉@么多麻煩。
我直接執(zhí)行sudo是會有提示的(我以為會不讓執(zhí)行sudo命令)
而后我又輸入了錯誤的語法,誤以為普通用戶是可以執(zhí)行sudo的,對不起,麻煩各位了,謝謝!
以后學(xué)習(xí)看書的時候我會仔細的。

論壇徽章:
48
15-16賽季CBA聯(lián)賽之青島
日期:2021-01-07 13:41:2315-16賽季CBA聯(lián)賽之上海
日期:2020-12-01 18:02:0720周年集字徽章-20	
日期:2020-10-28 14:14:2620周年集字徽章-20	
日期:2020-10-28 14:04:3015-16賽季CBA聯(lián)賽之天津
日期:2020-10-18 22:51:412016猴年福章徽章
日期:2016-02-18 15:30:3415-16賽季CBA聯(lián)賽之北控
日期:2015-12-22 13:30:48操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-12-07 06:20:00操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-09-04 06:20:002015亞冠之德黑蘭石油
日期:2015-08-05 18:46:082015年亞洲杯之巴勒斯坦
日期:2015-04-19 10:42:502015年亞洲杯之巴林
日期:2015-04-09 08:03:23
6 [報告]
發(fā)表于 2013-05-31 13:52 |只看該作者
LZ用普通用戶運行什么命令了?如果是非root也能執(zhí)行的命令。。。還是把你普通用戶運行sudo的完整輸出貼出來看眼吧~

論壇徽章:
16
IT運維版塊每日發(fā)帖之星
日期:2015-10-02 06:20:00IT運維版塊每月發(fā)帖之星
日期:2015-09-11 19:30:52IT運維版塊每周發(fā)帖之星
日期:2015-09-11 19:20:31IT運維版塊每日發(fā)帖之星
日期:2015-08-26 06:20:00每日論壇發(fā)貼之星
日期:2015-08-20 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-08-20 06:20:002015年辭舊歲徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09雙子座
日期:2013-12-17 16:44:37辰龍
日期:2013-11-22 15:20:59獅子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
7 [報告]
發(fā)表于 2013-05-31 13:56 |只看該作者
樓主你的錯誤能帶來大家更大的疑惑。我看完你的第一個帖子也再懷疑sudo。那么差勁么?
不過ubuntu里的sudo是默認打開的。

論壇徽章:
381
CU十二周年紀念徽章
日期:2014-01-04 22:46:58CU大;照
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大;照
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大;照
日期:2013-04-17 11:17:32CU大;照
日期:2013-04-17 11:17:37CU大;照
日期:2013-04-17 11:17:42CU大;照
日期:2013-04-17 11:17:47CU大;照
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
8 [報告]
發(fā)表于 2013-05-31 13:59 |只看該作者
@wenhqubuntu那個是系統(tǒng)安裝的時候定義的用戶,默認就加到sudo組了,在sudo的配置里面有sudo組的定義,所以默認那個用戶就可以.
你要是再新建一個用戶的話,sudo就不行了

論壇徽章:
381
CU十二周年紀念徽章
日期:2014-01-04 22:46:58CU大;照
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大;照
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大;照
日期:2013-04-17 11:17:19CU大;照
日期:2013-04-17 11:17:32CU大;照
日期:2013-04-17 11:17:37CU大;照
日期:2013-04-17 11:17:42CU大;照
日期:2013-04-17 11:17:47CU大;照
日期:2013-04-17 11:17:52CU大;照
日期:2013-04-17 11:17:56
9 [報告]
發(fā)表于 2013-05-31 14:01 |只看該作者
@Gchaeg你需要關(guān)注命令的輸出,其實你的那個命令的錯誤輸出已經(jīng)能說明很多問題了

論壇徽章:
16
IT運維版塊每日發(fā)帖之星
日期:2015-10-02 06:20:00IT運維版塊每月發(fā)帖之星
日期:2015-09-11 19:30:52IT運維版塊每周發(fā)帖之星
日期:2015-09-11 19:20:31IT運維版塊每日發(fā)帖之星
日期:2015-08-26 06:20:00每日論壇發(fā)貼之星
日期:2015-08-20 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-08-20 06:20:002015年辭舊歲徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09雙子座
日期:2013-12-17 16:44:37辰龍
日期:2013-11-22 15:20:59獅子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
10 [報告]
發(fā)表于 2013-05-31 14:02 |只看該作者
回復(fù) 8# chenyx


    en.thanks.
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP