52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-21 14:08:00 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-21 14:12 蝺刻摩
" l0 }+ }! B/ }0 o; u7 z+ b0 n9 k1 N) v+ h- }
su=switch user ,頧郢oot 撣唾
/ N* d. ?  E# f) _' ]sudo 臭誑root甈瑁賊賭誘,靘憒: sudo service mysqld restart,抵隤芣憒銝:1 j( f# {5 I; f9 i8 L

7 s" K; d* Y" k. e0 g4 |
Linux摰鋆憟隞嗉蝟餌絞閮剖賡閬root甈嚗撠望盎uper-user privileges (擃甈)嚗銋撠望舐恣⊥憒雿root甈嚗臭誑湔亦究sh餃叵oot撣唾嚗究u(substitute user)隞支雿輻刻嚗銝嗅停臭蝙究udo隞扎
. W1 m+ d7 f$ C' E9 J$ d) `# N/ k6 n/ v* L/ |5 d+ X
1. 雿輻究u隞
  1. #究u雿輻刻) O8 o# t, r/ T( i
  2. [aaron@phoenix ~]$ su#雿輻究u氳oot
    4 F. Q4 d# m7 b9 R% ?2 L$ l
  3. Password:[頛詨叵oot撖蝣奭
      q' O5 X7 ^( m

  4. ! Z: I3 F, b3 Y! A& k
  5. [root@phoenix aaron]# service httpd restart#撌脣氳oot7 \$ Y( Z6 @0 q1 }: p
  6. Stopping httpd:                                            [  OK  ]
    3 n# V1 F* W' e& n( t, O- P: U
  7. Starting httpd:                                            [  OK  ]
    & H3 q- l% D6 f7 b+ J- U" t/ x
  8. 2 P/ e* ]0 ^  k- @
  9. [root@phoenix aaron]# exit#aaron
    ! p+ o; X3 A* [0 Z& u/ g
  10. / k. e4 S: t) L5 f% ~) h6 d, w
  11. #瑁桐隞歹銝閬氳oot
    & v9 k; B, n8 M+ b+ M8 X: o
  12. [aaron@phoenix ~]$ su -c "service httpd restart"$ L# J, c0 T. o: W: b9 `+ m
  13. Password:[頛詨叵oot撖蝣奭7 C+ o7 G3 ?% u  B/ p! Z
  14. Stopping httpd:                                            [  OK  ]
    * }% c$ s! Q% P% I. N# R( ~
  15. Starting httpd:                                            [  OK  ]
    ! I; c5 Z6 p! k! u, T4 V7 ]- Y
  16. & H" B! i4 M& Y& \1 Y; d3 {
  17. #瑁susu -撌桀(Shell啣臬西)/ K' I8 S/ b0 O( R# J' p: v" G
  18. [aaron@phoenix ~]$ su
    : T' T- W: q: M. Y! o
  19. Password:[頛詨叵oot撖蝣奭
    # W% s. i9 i; o0 `0 p
  20. [root@phoenix aaron]# echo $PATH#訐ATH霈賂潛暸雿輻災aronPATH霈
    ! V1 n# `1 k3 a
  21. /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/aaron/bin
    ' j+ c' S( u  C# C: m' h( m0 q
  22. 8 J$ p' s  {* d% @( v$ g, G
  23. [aaron@phoenix ~]$ su -
    . v& d- q0 A, o9 Z1 T3 a0 v/ v$ c
  24. Password:[頛詨叵oot撖蝣奭
    $ _& v, `5 K* F6 p8 A
  25. [root@phoenix aaron]# echo $PATH#訐ATH霈賂雿輻禿ootPATH霈: v1 \+ I5 V5 m% h- U
  26. /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
銴鋆賭誨蝣
* ]- X: ~6 ?3 p6 V7 @" R! Z
2. 閮剖sudoer

. w2 ^; V" y4 l
  1. [aaron@phoenix ~]$ su
    3 g" I( B4 h8 ~9 w8 W' O# u; k' ~, N
  2. Password:[頛詨叵oot撖蝣奭
    3 X* I+ y- }4 k& v) M" _( L4 d8 O

  3. 5 K& W6 G5 X5 \7 R' s) r( [) I' v
  4. [root@phoenix aaron]# vim /etc/sudoers/ O" v- l$ [% g4 W
  5. ( X2 W% B. H$ k! y" B; k7 Z
  6. ## Allow root to run any commands anywhere; `0 d3 ?+ A* H* [5 G1 V  }
  7. root    ALL=(ALL)       ALL. R7 e+ I1 Q' `4 A# s/ C; x7 I
  8. & T1 j+ D" B6 Z% s7 P& V) p9 R
  9. ## Allow users to run any commands anywhere
    2 D4 g: R1 E* h- r( V# w* X$ Q  {
  10. aaron   ALL=(ALL)       ALL#啣璇閮帶aron臭誑瑁蝞∠⊥
銴鋆賭誨蝣

" {* l7 x, |' X* I- p; K* P3. 蝭靘
  1. #瘝擃甈嚗隞亙停鋡急鈭
    : N- C; [& {# [
  2. [aaron@phoenix ~]$ service httpd restart
    9 B# i: I+ i) V9 C8 v
  3. Stopping httpd:/ K! B2 N6 o. r% W- n
  4. rm: cannot remove `/var/run/httpd/httpd.pid': Permission denied
    3 P& N4 H; v0 J6 C
  5. 5 p2 z* ]( n: D' t& b
  6. Starting httpd:% i5 j; a% W5 F/ k  p4 S
  7. touch: cannot touch `/var/lock/subsys/httpd': Permission denied
    # \; T+ g) x0 P, I
  8. : g8 }' C* E$ U8 o/ J
  9. #究udo撠勗臭誑9 f' a9 v/ c0 r4 A3 h
  10. [aaron@phoenix ~]$ sudo service httpd restart
    7 t- a5 Y1 l% Q
  11. [sudo] password for aaron:[頛詨亙蝣奭8 p1 E. S) D4 R* U4 w) r
  12. Stopping httpd:                                            [  OK  ]
    % v; p- J" H( d* n" p( p4 ^: I
  13. Starting httpd:                                            [  OK  ]
銴鋆賭誨蝣
#susudo撌桀亙冽潭臬西霈銝砌蝙刻仿root撖蝣潘憒究u撠勗撠root撖蝣澆鈭怠箏鳴敺航賡蝟餌絞鋡思噩亦梢芥sudo航銝砌蝙刻蝞∠⊥嚗芾頛詨亥芸楛撖蝣澆喳荔雿璅憸券迎箸蝞∠⊥" M2 g8 p/ h1 V, f
http://kezeodsnx.pixnet.net/blog/post/25810396

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-21 23:11 , Processed in 0.069384 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵