52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
Yahoo!憟拇撠
望: 璈A
Google憟拇撠
望: 璈A
     
亦: 3475|敺: 0
銝銝銝駁 銝銝銝駁

[linux隞也 Linux 銝 su v.s sudo 隞斗頛

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-21 14:08:00 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-21 14:12 蝺刻摩
) P/ k' y' K4 h( {- d4 I0 \; y3 V+ b% n9 `) G; l3 H; G2 s
su=switch user ,頧郢oot 撣唾
" D8 N( T; [, i$ ]) Ssudo 臭誑root甈瑁賊賭誘,靘憒: sudo service mysqld restart,抵隤芣憒銝:5 {) G& Z2 ~# u$ M( l' Q% ^

# ?7 [* Z2 @, Q9 {8 T8 R
Linux摰鋆憟隞嗉蝟餌絞閮剖賡閬root甈嚗撠望盎uper-user privileges (擃甈)嚗銋撠望舐恣⊥憒雿root甈嚗臭誑湔亦究sh餃叵oot撣唾嚗究u(substitute user)隞支雿輻刻嚗銝嗅停臭蝙究udo隞扎
8 I! w' d2 r0 w) d" A; I2 B5 c$ d" `- L' B  M
1. 雿輻究u隞
  1. #究u雿輻刻
    " D( }' |0 a5 _% B) x$ Z3 U9 V5 m" k, V
  2. [aaron@phoenix ~]$ su#雿輻究u氳oot
    , \6 ?7 v: ~1 U2 Y$ y1 U5 h: M
  3. Password:[頛詨叵oot撖蝣奭
    6 a2 G3 l% E7 S5 n& {* I3 ~6 B) @
  4. - s9 {+ C1 A1 A' ]* F
  5. [root@phoenix aaron]# service httpd restart#撌脣氳oot  p( f8 p7 s" m7 J5 @3 G3 l
  6. Stopping httpd:                                            [  OK  ]
    % e! f5 |  ~5 p2 M: p- _
  7. Starting httpd:                                            [  OK  ]6 z3 ?5 y* q: ^: g

  8. : Y3 N! j9 k: ~$ s: s" o$ G0 l
  9. [root@phoenix aaron]# exit#aaron
    9 }/ z. m$ {" P

  10. : M3 t& Q3 G2 K5 A. |, Q
  11. #瑁桐隞歹銝閬氳oot% e5 V  P- S4 `3 ]; P& `0 Q  o+ i& w4 d' ]
  12. [aaron@phoenix ~]$ su -c "service httpd restart"
    6 H& p5 E- N( }, I; m  y  ~
  13. Password:[頛詨叵oot撖蝣奭% F, B5 x$ C& }# U% \# o
  14. Stopping httpd:                                            [  OK  ]
    1 j' ~1 i8 V% j
  15. Starting httpd:                                            [  OK  ]' N0 P8 p: o0 X# K$ G( P- P2 D
  16.   u- N7 @3 J. E$ x  f
  17. #瑁susu -撌桀(Shell啣臬西)
    ) O  {$ W( g+ K8 {1 F
  18. [aaron@phoenix ~]$ su. Y, @! C- I6 {6 X" O
  19. Password:[頛詨叵oot撖蝣奭
    9 {* ^4 u, |0 X5 A7 B5 L, v% r
  20. [root@phoenix aaron]# echo $PATH#訐ATH霈賂潛暸雿輻災aronPATH霈: k1 N4 P# u; `1 t. @7 v, ~
  21. /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/aaron/bin
    3 Y2 W. t9 \: q  H! }/ _- H) V
  22. : _$ {6 e$ s; ~- j! ~# Y" E# f8 }
  23. [aaron@phoenix ~]$ su -
    : t/ d# i7 E' @
  24. Password:[頛詨叵oot撖蝣奭
    6 c" F8 Y- p. {6 ?+ b# n
  25. [root@phoenix aaron]# echo $PATH#訐ATH霈賂雿輻禿ootPATH霈
    9 ^5 k+ X; q4 C7 p
  26. /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
銴鋆賭誨蝣
5 O; H0 L8 L, a4 o# d; C; U
2. 閮剖sudoer
8 g  a; Q  s0 n( R6 E+ x
  1. [aaron@phoenix ~]$ su
    " A* b+ i0 R* V1 z# c5 C
  2. Password:[頛詨叵oot撖蝣奭
    1 b' {+ [' R9 c. A% O

  3. " i& U. W2 }9 }  f9 M4 J
  4. [root@phoenix aaron]# vim /etc/sudoers
      f$ W) S8 z& F- {/ H: s* y
  5. & Y9 r9 h: h4 ~8 _$ y
  6. ## Allow root to run any commands anywhere8 w& {2 M# u& ?9 O( O* m+ Y4 t
  7. root    ALL=(ALL)       ALL
    / i4 T: P+ v1 N" U/ g
  8. 3 S; L1 Z1 O8 N1 M
  9. ## Allow users to run any commands anywhere$ ?' m2 g- R. k# D+ g4 `( w
  10. aaron   ALL=(ALL)       ALL#啣璇閮帶aron臭誑瑁蝞∠⊥
銴鋆賭誨蝣
8 [3 a7 M# x  y; X  C/ X
3. 蝭靘
  1. #瘝擃甈嚗隞亙停鋡急鈭
    $ W; L: T1 D, a; Q; J
  2. [aaron@phoenix ~]$ service httpd restart
    - y" _2 d) I' F  B8 _
  3. Stopping httpd:7 M2 P0 o* {* Z: @6 n
  4. rm: cannot remove `/var/run/httpd/httpd.pid': Permission denied
    9 K7 N: Z0 ~0 W0 }3 ~. `6 a

  5. $ W2 S/ t, C- A  \% E1 z
  6. Starting httpd:  L# O3 V1 r- z1 R% c
  7. touch: cannot touch `/var/lock/subsys/httpd': Permission denied
    : U) \# ]# |/ \

  8. ' H0 p9 Q& t, X6 @/ [
  9. #究udo撠勗臭誑
    7 p; l4 n& h+ b* X
  10. [aaron@phoenix ~]$ sudo service httpd restart& W; B( |) A7 c7 i4 l1 B7 b
  11. [sudo] password for aaron:[頛詨亙蝣奭
    : z2 r& _* ]$ j4 k
  12. Stopping httpd:                                            [  OK  ]1 d1 c3 y1 K5 n. }
  13. Starting httpd:                                            [  OK  ]
銴鋆賭誨蝣
#susudo撌桀亙冽潭臬西霈銝砌蝙刻仿root撖蝣潘憒究u撠勗撠root撖蝣澆鈭怠箏鳴敺航賡蝟餌絞鋡思噩亦梢芥sudo航銝砌蝙刻蝞∠⊥嚗芾頛詨亥芸楛撖蝣澆喳荔雿璅憸券迎箸蝞∠⊥
# c% j1 ]" X+ q0 n1 f
http://kezeodsnx.pixnet.net/blog/post/25810396

雿輻券

祉蝛閬

BT蝳

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-24 08:11 , Processed in 0.062796 second(s), 16 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵