4

I've edited /etc/passwd by running usermod -s to change my shell. (chsh doesn't work, because it prompts for a password; we SSH in using keys.)

When I disconnect, and reconnect, the change doesn't take effect. I've restarted sshd too, and still nothing.

  • You don't necessarily have to live with that chsh problem. At least in the Linux version the password prompting is configurable. If you ask a separate question and mention your OS version you might get it fixed. – user41515 Feb 4 '15 at 0:32
7

I use ControlMaster, and I wasn't actually disconnecting.

ControlMaster is an SSH configuration option that keeps connections open for a certain time, and can multiplex SSH sessions over the same connection (which avoids key exchanges, which are slow). However, if you ^D from a shell, and then re-run ssh, you've not killed the original connection.

Restarting sshd only restarts the listening process: any in-progress session remain alive, so that doesn't restart the connection either.

Apparently launching a new shell doesn't re-check /etc/passwd for changes.

Solution was just to kill the connection: ssh <hostname> -O exit, and log in again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.