1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Login incorrect error after changing shell

Discussion in 'General' started by dbbolton, May 30, 2012.

  1. dbbolton

    dbbolton New Member

    Messages:
    33
    Likes Received:
    0
    I've installed FreeBSD 9 in a VM. I have one user account aside from root. I installed the zsh package and then set root's and my shell using chsh to /usr/local/bin/zsh, which was a valid entry in /etc/shells. After rebooting, I cannot log in. I know what the passwords are, and they are not incorrect. I used the recommended partition scheme including a boot, root, and swap partition; /usr is not separate or unmounted.

    I have also tried booting into single user mode, running /bin/sh, mounting the filesystem, and resetting the password, but this did not work either.
     
  2. Anonymous

    Anonymous Guest

    Can you boot into single user mode and reset the passwords?
     
  3. dbbolton

    dbbolton New Member

    Messages:
    33
    Likes Received:
    0
    Yes. When I run whoami, the result is 0. passwd root results in
    Code:
    no such user
    I also tried editing master.password. I erased the password hash for root and reset the shell to /bin/sh. When I try to log in as root, it still prompts for a password, I hit enter, and I still get the login incorrect message.
     
  4. kpa

    kpa Member

    Messages:
    3,993
    Likes Received:
    5
    Use vipw(8) for editing /etc/master.passwd, FreeBSD uses external db(3) style databases for user account files that need to created from the master file using proper utilities. The default shell for root is /bin/csh, don't change that to anything else.
     
  5. dbbolton

    dbbolton New Member

    Messages:
    33
    Likes Received:
    0
    After again booting into single-user mode and running vipw, I see that my changes made to the file using regular vi had stuck. I edited root's shell to csh, and rebooted. After this I was able to log in as root and reset the password.

    However, I still don't understand why my regular user cannot log in with zsh.
     
  6. Anonymous

    Anonymous Guest

    First of all, you shouldn't change your original post so much after you get responses to it. It makes the rest of the thread appear out of order, making less sense to anyone reading it, and therefore of less help to future people having the same problem.

    After entering your username and password what is the exact wording of the error message you're getting? Is it just
    Code:
    Login incorrect
    and then goes back to
    Code:
    login: 
    on the next line?
     
  7. dbbolton

    dbbolton New Member

    Messages:
    33
    Likes Received:
    0
    Yes. It seems that the issue was how I used chsh. The first time, I ran it with no arguments, which spawned an editor where I entered the chagne manually (which led to the error). After resetting my shell to /bin/csh, I was able to log in. Then I ran $ chsh -s /usr/local/bin/zsh, and that worked.

    In response to my inclusion of additional information in the OP, I wanted anyone who finds this thread (whether member or not) to be able to get a quick overview of the whole issue in the first post, as opposed to reading the entire thread, since sometimes threads can get quite lengthy. If your suggestion is an enforceable community guideline, I will be happy to follow it.