The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Sudo question

    Discussion in 'Linux Compatibility and Software' started by Evil Claw, Jul 29, 2011.

  1. Evil Claw

    Evil Claw Notebook Evangelist

    Reputations:
    7
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    30
    Trying to enter some script in the terminal to add weather, etc... and after the command is entered it asks for user password and I enter my password(however I am typing my password, the cursor never moves) and hit return and nada, incorrect password. Huh?? I read up on this over at ubuntu help page and it should work with my password. Am I missing something(obviously). :confused:
     
  2. jalaj

    jalaj Notebook Geek

    Reputations:
    13
    Messages:
    88
    Likes Received:
    1
    Trophy Points:
    16
    Your root account password might be different from your user account password.

    Edit: actually I was incorrect, according to this wiki, says that root account by default is locked
    https://help.ubuntu.com/community/RootSudo
     
  3. Sxooter

    Sxooter Notebook Virtuoso

    Reputations:
    747
    Messages:
    3,784
    Likes Received:
    8
    Trophy Points:
    106
    Check your /etc/group file for the admin entry. Are you a member of that group?
     
  4. Evil Claw

    Evil Claw Notebook Evangelist

    Reputations:
    7
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    30
    Under the "users and groups", I am listed and have the "administer the system" box checked under advanced settings. I checked under manage groups and I am under "admin".
     
  5. naticus

    naticus Notebook Deity

    Reputations:
    630
    Messages:
    1,767
    Likes Received:
    0
    Trophy Points:
    55
    try using 'su' instead and the password you normally use.

    Also try 'sudo -i' and when prompted just press 'enter' with no password -- if using *buntu.
     
  6. TuxDude

    TuxDude Notebook Deity

    Reputations:
    255
    Messages:
    921
    Likes Received:
    2
    Trophy Points:
    31
    Ubuntu by default adds the first user for sudo privileges (but I dont know why the hell they feel they have to disable the root account by removing the password for it and it adds more security)

    You should be added to /etc/sudoers or to a group (which is specified in /etc/sudoers) that you should be a member of to have sudo privileges.

    Yes in *nix the cursor wont move while entering the password - basically it disables the echo so whatever you type doesnt get displayed on the screen - more than good enough rather than showing how long your password is using asterik characters.

    "sudo -i" would again ask for your password and I doubt it would work without entering any password. If your /etc/sudoers is configured that you have sudo access without a password it wont prompt you for a password in the first place. Your command would help you get an interactive shell as root just like a su command would (if the root account were not disabled).

    There are three ways an user can be configured to have sudo access:
    1. The user should enter the root password each time when asked
    2. The user should enter his/her own password each time when asked
    3. The user need not enter any password at all.

    AFAIK Ubuntu follows method 2, and most other distros follow 1. Note 1 will not work if the root account is disabled i.e. removing the password for root account.

    So to answer to your question - yes enter your own password taking care of the case and you should be good. If that doesn't work your password is incorrect or someone modified your /etc/sudoers to remove your user from the list.
     
  7. Evil Claw

    Evil Claw Notebook Evangelist

    Reputations:
    7
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    30
    Okay, found the issue. Under "users and groups", I was listed as a group. Then under "manage group", there are group settings and there is a heading called "sudo" of which I was listed but box not checked. Checked the box and all is well. :rolleyes: I saw "Admin" at the beginning and thought that was the only one that needed to be checked. Oh well, learning experience. ;)
     
  8. Bashar

    Bashar Notebook Evangelist

    Reputations:
    33
    Messages:
    640
    Likes Received:
    5
    Trophy Points:
    31
    also visudo and just add NOPASSWD: infront of your username and it'll never ask you for a pass in future

    if there is no line for your username add one
     
  9. TuxDude

    TuxDude Notebook Deity

    Reputations:
    255
    Messages:
    921
    Likes Received:
    2
    Trophy Points:
    31
    Yes good point about visudo, it is always advisable to use visudo to edit /etc/sudoers rather than editing directly - if you make any mistakes it wont let you exit until the sudoers file is valid.