52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-21 14:08:00 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-21 14:12 蝺刻摩
( l% O0 M& E$ f+ c' I9 ~. n" z. E
: X3 w" ]* h- w3 |3 ?. L9 ]su=switch user ,頧郢oot 撣唾8 L6 Z! I* y: I7 r/ F* Y5 t- B5 p
sudo 臭誑root甈瑁賊賭誘,靘憒: sudo service mysqld restart,抵隤芣憒銝:$ v& p8 \4 t* i" g
4 o6 v% b5 M9 }# Y
Linux摰鋆憟隞嗉蝟餌絞閮剖賡閬root甈嚗撠望盎uper-user privileges (擃甈)嚗銋撠望舐恣⊥憒雿root甈嚗臭誑湔亦究sh餃叵oot撣唾嚗究u(substitute user)隞支雿輻刻嚗銝嗅停臭蝙究udo隞扎
7 X! i7 j3 q! @$ \6 U4 h& q/ j  d+ p: a& A
1. 雿輻究u隞
  1. #究u雿輻刻
    $ \3 \. L" N8 K, b% y- B
  2. [aaron@phoenix ~]$ su#雿輻究u氳oot
    & A9 p8 d. z9 \5 [" _
  3. Password:[頛詨叵oot撖蝣奭+ G  f! E. a' W- @2 D  t0 Z* U9 z
  4. , n9 {, P* b$ k% _
  5. [root@phoenix aaron]# service httpd restart#撌脣氳oot
    ( _" n+ W4 O( }) ^) o
  6. Stopping httpd:                                            [  OK  ]
    " ?" r1 N0 f2 F0 q$ @5 w
  7. Starting httpd:                                            [  OK  ]! G1 [5 c& o( q7 D3 H
  8. ; `1 |% ^' ^% ]: M# c/ R
  9. [root@phoenix aaron]# exit#aaron' d" X: z2 f% d) C- q

  10. 7 R' m, v' M; x# u8 H2 _. b0 d$ s
  11. #瑁桐隞歹銝閬氳oot- \5 L% L+ Q- R7 v% `0 s/ ?: c
  12. [aaron@phoenix ~]$ su -c "service httpd restart"
    6 }  j; t5 s/ e& w0 P# ^
  13. Password:[頛詨叵oot撖蝣奭/ y' y. v' g" C
  14. Stopping httpd:                                            [  OK  ]$ R! X: a  I/ k. R" z
  15. Starting httpd:                                            [  OK  ]3 n" U4 z( p0 `+ a2 N' Q
  16. * E; Y. m. L$ Z/ K! `4 [% Y
  17. #瑁susu -撌桀(Shell啣臬西)
    $ I. T; }4 }' V6 n% s
  18. [aaron@phoenix ~]$ su
    & h" I, M* P( J9 i  }
  19. Password:[頛詨叵oot撖蝣奭
    . @# U/ ~. @, S+ `# h
  20. [root@phoenix aaron]# echo $PATH#訐ATH霈賂潛暸雿輻災aronPATH霈: [1 {( t  R) F3 e- W3 Y& t8 N
  21. /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/aaron/bin
    # B! F3 o" f& h$ V" N8 m% E& m

  22. - m4 L5 |5 q" O6 q/ ?
  23. [aaron@phoenix ~]$ su -- Z( ^0 a+ d2 D9 i2 h7 R
  24. Password:[頛詨叵oot撖蝣奭5 ?1 w* U! q  {6 A: Q( [; U
  25. [root@phoenix aaron]# echo $PATH#訐ATH霈賂雿輻禿ootPATH霈9 t  b; ~4 h$ F) k$ D5 w
  26. /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
銴鋆賭誨蝣
/ Q! p& v7 u" Z# ?% V7 [
2. 閮剖sudoer
2 a5 V4 ^: w" J; O/ }. J- i9 C3 j
  1. [aaron@phoenix ~]$ su
    " U" C2 J4 x# _6 L+ X$ X
  2. Password:[頛詨叵oot撖蝣奭
    9 Y3 w* |5 g( K1 f: G6 ]

  3. 1 |( X) ]7 S$ E( G. P6 U5 e, `9 N
  4. [root@phoenix aaron]# vim /etc/sudoers( m+ c' D: B* N3 j$ E
  5. + `* T& u# B9 J1 h- v
  6. ## Allow root to run any commands anywhere1 }0 W  X1 ?2 [, v8 ~. s. F+ @
  7. root    ALL=(ALL)       ALL+ W* M/ R6 Q) C# M
  8. 4 ^! U; m( F. I+ k
  9. ## Allow users to run any commands anywhere
    * {7 L, _5 y1 L6 y" N, k2 o
  10. aaron   ALL=(ALL)       ALL#啣璇閮帶aron臭誑瑁蝞∠⊥
銴鋆賭誨蝣
; ^# n% ~' L* G* a3 b
3. 蝭靘
  1. #瘝擃甈嚗隞亙停鋡急鈭
      o! i, O  s, f5 Y3 X( X* ~& n
  2. [aaron@phoenix ~]$ service httpd restart
    ! Q" d- p) Z0 }- p
  3. Stopping httpd:
    6 \/ y5 d0 j: S9 B
  4. rm: cannot remove `/var/run/httpd/httpd.pid': Permission denied6 Q# H" {+ f* T7 ?' `, J
  5. / c9 |& T, \8 k
  6. Starting httpd:( l% R3 R% p) U( g
  7. touch: cannot touch `/var/lock/subsys/httpd': Permission denied
    4 p0 L7 w8 L$ O( g" d9 D1 x- c1 b
  8.   Q- X/ \6 p  F. D. I( [9 i- b4 E. c
  9. #究udo撠勗臭誑
      g4 U- x2 p, g4 p6 w* H
  10. [aaron@phoenix ~]$ sudo service httpd restart
    $ y% G, h5 O& i1 b0 X
  11. [sudo] password for aaron:[頛詨亙蝣奭4 K; m" M, _: A: B3 Z. E" l
  12. Stopping httpd:                                            [  OK  ]+ J+ ^* @/ g% H3 M7 t
  13. Starting httpd:                                            [  OK  ]
銴鋆賭誨蝣
#susudo撌桀亙冽潭臬西霈銝砌蝙刻仿root撖蝣潘憒究u撠勗撠root撖蝣澆鈭怠箏鳴敺航賡蝟餌絞鋡思噩亦梢芥sudo航銝砌蝙刻蝞∠⊥嚗芾頛詨亥芸楛撖蝣澆喳荔雿璅憸券迎箸蝞∠⊥
9 J* ?6 h( E0 f  B# }
http://kezeodsnx.pixnet.net/blog/post/25810396

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-12-4 01:33 , Processed in 0.062827 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵