Linux System Engineer Community Thailand
ยินดีต้อนรับคุณ,
บุคคลทั่วไป
กรุณา
เข้าสู่ระบบ
หรือ
ลงทะเบียน
พฤษภาคม 21, 2012, 03:35:00 am
1 ชั่วโมง
1 วัน
1 สัปดาห์
1 เดือน
ตลอดกาล
เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
สอบ RHCE, สอบ Cert Red Hat, Red Hat Certified RHCE หาข้อมูลได้ที่นี่ [RHCE Thailand Start here]
หน้าแรก
ช่วยเหลือ
ค้นหา
เข้าสู่ระบบ
สมัครสมาชิก
Advertise 299X69 pixel at here สนใจโฆษณาคลิ๊กที่นี่ครับ
Linux System Engineer Community Thailand
Knowledge Zone
General RHL, RHEL, Fedora, Other Open Platform
ทำไมใช้ sudo useradd ไม่ได้
หน้า: [
1
]
« หน้าที่แล้ว
ต่อไป »
ผู้เขียน
หัวข้อ: ทำไมใช้ sudo useradd ไม่ได้ (อ่าน 872 ครั้ง)
noktualek
Newbie
กระทู้: 29
ทำไมใช้ sudo useradd ไม่ได้
«
เมื่อ:
มกราคม 10, 2011, 09:16:32 am »
ทำไมใช้ sudo useradd ไม่ได้
[nok@centos ~]$
sudo
useradd nok1
sudo: useradd: command not found
cat /etc/group |grep nok ## nok1 อยู่ใน group poweruser แล้ว
root:x:0:root,nok,aus1
nok:x:501:
poweruser:x:503:nok,aus1
$ cat /etc/sudoers |grep poweruser ## ใน sudoers เพิ่มสิทธิ์ group poweruser แล้ว
## Allow poweruser Group
%poweruser ALL=(ALL) NOPASSWD: ALL
ขอบคุณสำหรับคำแนะนำครับ
บันทึกการเข้า
gunshift
บุคคลทั่วไป
Re: ทำไมใช้ sudo useradd ไม่ได้
«
ตอบ #1 เมื่อ:
มกราคม 10, 2011, 10:16:14 am »
ลอง
[nok@centos ~]$ sudo /usr/sbin/useradd nok1
บันทึกการเข้า
noktualek
Newbie
กระทู้: 29
Re: ทำไมใช้ sudo useradd ไม่ได้
«
ตอบ #2 เมื่อ:
มกราคม 20, 2011, 10:20:01 am »
เราจะเพิ่ม path /usr/sbin/ ให้กับ user nok1 ได้อย่างไรครับ โดยปกติแล้ว path ที่ใช้ๆ กันมีอะไรบ้าง พอมีคำสั่งเช็คหรือเปล่าครับ
ขอบคุณครับ
Noktualek
บันทึกการเข้า
sysadm
Administrator
กระทู้: 212
liunxsyseng.com [ลินุกซ์-ซีด-เอน]
Re: ทำไมใช้ sudo useradd ไม่ได้
«
ตอบ #3 เมื่อ:
มกราคม 20, 2011, 10:31:09 am »
เวลา แก้ sudo ใช้
sudoedit /etc/sudoers หรือ vim /etc/sudoers
ปกติหาก Allow poweruser น่าจะทำได้นะครับ ไม่ต้อง add path เพิ่มครับ
บันทึกการเข้า
liunxsyseng.com [ลินุกซ์-ซีด-เอน] ยินดีต้อนรับ
sysadm@linuxsyseng.com
noktualek
Newbie
กระทู้: 29
Re: ทำไมใช้ sudo useradd ไม่ได้
«
ตอบ #4 เมื่อ:
มกราคม 20, 2011, 12:45:26 pm »
$ echo $PATH ของ nok
/usr/local/bin:/bin:/usr/bin:/home/nok/bin ไม่มี /usr/sbin
# echo $PATH ของ root
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:
/usr/bin
:/root/bin
# find / -name useradd
/usr/sbin/
useradd ทำให้ทราบว่า ทำไม nok จึงใช้ useradd ตรง ๆ ไม่ได้
/etc/default/useradd
ผมจะเช้าไปเพิ่ม PATH /usr/sbin ให้กับ nok ได้อย่างไรครับ
ขอบคุณครับ
Noktualek
«
แก้ไขครั้งสุดท้าย: มกราคม 20, 2011, 02:43:33 pm โดย noktualek
»
บันทึกการเข้า
หน้า: [
1
]
« หน้าที่แล้ว
ต่อไป »
กระโดดไป:
เลือกหัวข้อ:
-----------------------------
General Category Zone
-----------------------------
=> Announcement
-----------------------------
Knowledge Zone
-----------------------------
=> General RHL, RHEL, Fedora, Other Open Platform
=> Application RH, RHEL, Fedora, Other Open Platform
=> General Databases, Open Database Platform
=> Certificate RHCT/RHCE Other Cert.
=> Basic Linux know how
=> Documents Center
-----------------------------
Other Zone
-----------------------------
=> Living Room
=> Public Relations
=> Linux Jobs
กำลังโหลด...