Benx Blog

六月 10, 2010

Diigo Diary 06/10/2010

Filed under: Diigo Diary — benxshen @ 8:30 上午
  • tags: ubuntu, theme

  • tags: fedora, sudo, howto

    • Setup sudo

      07 November 2007

      Fedora, like all other Linux distributions, has a root user and has
      individual users. The root is the “superuser", somewhat similar to
      “Administrator" in Windows.

      Use the personal account you created at First Boot for daily use root only for administration/configuration. To run as ‘root’ use su or sudo commands. However sudo requires setup. As root run:

      echo 'loginname ALL=(ALL) ALL' >> /etc/sudoers
      
      Where 'loginname' is your user account.
      Use 'ALL=(ALL) NOPASSWD:ALL' if you don't want to be prompted a password.
      If you are prompted for a password with 'sudo' it is the user password, not root.
      

      Example:

      [mirandam@charon ~]$ su
      Password:    <--- Enter root password
      
      [root@charon mirandam]# echo 'mirandam ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
      [root@charon mirandam]# exit
      exit

      The following is an example of how sudo lets you execute root commands:

      [mirandam@charon ~]$ du -sh /root
      du: `/root': Permission denied  <--- Fails!!!
      
      [mirandam@charon ~]$ sudo du -sh /root
      163M    /root                   <--- Works!!!
      

      NOTE: Every command provided on this page will work if you remove sudo from the command. However this requires you must be logged in as ‘root’. An alternative to using sudo is to use su to login as root, before executing a command.

Posted from Diigo. The rest of my favorite links are here.

發表迴響 »

仍無迴響。

RSS feed for comments on this post. TrackBack URI

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

在WordPress.com寫網誌.

%d 位部落客按了讚: