Cannot authenticate without a password

6,740

The answer, you don't. You will need to set a password in order to authenticate to do anything requiring authentication.

Unfortunately after the password has been removed you cannot even change your password as you must be able to authenticate in order to change your password in the settings / user account screen.

The fix:

  1. Change your password using Terminal.

    Click the windows key or click the dash button to go to the dashboard. In the search box type term and click on the program called terminal.

  2. Type who am i and press enter to verify you are logged in as the user that you want to change.

  3. Type passwd and press enter. It will then ask you what password you want to change it to. Enter your new password and press enter. Then it will ask you to enter your password again to verify. Enter your password again and then press enter. Your password will now be set and you will now be able to authenticate again by using your new password.

Share:
6,740
Owen
Author by

Owen

Updated on September 18, 2022

Comments

  • Owen
    Owen over 1 year

    I have an existing function, and I'd like to add a parameter and set a default value for it so it won't affect other modules that use it.

    BOOL myFunc(int A, CString& strTest);
    

    Initializing it to NULL or 0 gives me an error message. How do I initialize strTest in my func declaration?

    • John S Gruber
      John S Gruber almost 12 years
      I'm probably the last to understand, but... Are you asking how to create/change an account that doesn't require a password to log in but you then have a password to enter when you want to change the system with sudo, gksudo, etc? Or how to have an account that doesn't require a password to either login or to use sudo?
    • Nanne
      Nanne over 11 years
      but even if there is no answer, surely that doesn't mean a duplicate should be opened?
    • Jorge Castro
      Jorge Castro over 11 years
    • Admin
      Admin about 10 years
      thank you so much! I wish i had seen your post two hours earlier!
  • Eliah Kagan
    Eliah Kagan almost 12 years
    The OP's question is about how to make it so that all local authentication will work without prompting for a password--or, to put it another way, how to make it so that no local authentication is ever performed. (A proper answer to this question would have to explain how to make sudo work without a password, and PolicyKit as well.)
  • irrational John
    irrational John almost 12 years
    @EliahKagan I'll take your word on it. It is hard for me to tell since the OP's question is not in the form of a question. Just two statements which describe how Ubuntu is (I assume) intended to work by design.
  • Eliah Kagan
    Eliah Kagan almost 12 years
    Good point. Indeed, my interpretation may be mistaken. I do not recommend that you delete this answer (in case my interpretation is wrong or in case it's right but the OP also intended to ask for this information).
  • Eliah Kagan
    Eliah Kagan almost 12 years
    I think there is actually a way to do this. You can configure sudo to not prompt for a password (and that includes when it's used via its graphical frontends). I suspect you can configure PolicyKit to do the same thing, though I'm not sure (if I knew how I'd post this as another answer rather than a comment). Assuming that's configured, just disable screen-lock, enable automatic login, and make the password blank. (Normally it would be bad to have a blank password, but if sudo and PolicyKit succeed without password authentication, then that wouldn't be a problem.)
  • Jammerz858
    Jammerz858 over 11 years
    That's the "automatic login" option. "Login without a password" is different.
  • Owen
    Owen about 11 years
    when I assign a value to strTest inside myFunc, it says Error 1 error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const CString' (or there is no acceptable conversion)
  • Jerry Coffin
    Jerry Coffin about 11 years
    @Owen: right -- if you make it const, you can't assign to it. If the user hasn't passed anything, where do you expect your assignment to go? I think you need to clarify what you want to accomplish -- trying to modify something that may not have been passed doesn't seem to make much sense.
  • Owen
    Owen about 11 years
    inside myFunc() another function passes a string. I would like to assign that string to myFunc's strTest. Can I use const_cast ?
  • Jerry Coffin
    Jerry Coffin about 11 years
    @Owen: Are you expecting what you assign to become visible to the caller of myFunc, or are you just using strTest as a local variable, so modifying it only changes what's visible locally?
  • Owen
    Owen about 11 years
    I'm expecting your first point... "expecting what you assign to become visible to the caller of myFunc"
  • Owen
    Owen about 11 years
    instead of public, can I set static CString defArg; to private?
  • Nayana Adassuriya
    Nayana Adassuriya about 11 years
    No prob man. It is up to you. as your requirement. if you no need to access this out side from class. make it private. :)
  • Owen
    Owen about 11 years
    I just figured another way. Instead of passing by reference, I used CString pointer and later dereference it.