in reply to Re^2: passwords with special characters are trying to kill me... no seriously!
in thread passwords with special characters are trying to kill me... no seriously!

it is still failing to set the password on the remote host using

Sorry, but that is an entirely different problem and one well outside my field of experience.

One thing that stands out though. Are you sure that /usr/bin/passwd will accept input from a pipe?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^3: passwords with special characters are trying to kill me... no seriously!
  • Download Code

Replies are listed 'Best First'.
Re^4: passwords with special characters are trying to kill me... no seriously!
by calmthestorm (Acolyte) on Feb 04, 2011 at 01:43 UTC
    Yep, I have been running this script for a few months and it works great as long as the password doesnt have a special character like "$" in it.

    From the passwd manpage:

           --stdin
                  This  option is used to indicate that passwd should read the new pass-
                  word from standard input, which can be a pipe.
    
Re^4: passwords with special characters are trying to kill me... no seriously!
by calmthestorm (Acolyte) on Feb 04, 2011 at 01:39 UTC
    Yep, it works like a charm, as long as the password does not contain any special characters.

      Then my best guess would be that echo $fred or even echo abc$xyz is being interpreted by the shell on the server and the '$...' bit is being substituted with the value of an enviroment variable of that name. Which probably doesn't exist, so it gets left blank.

      But that is pure speculation on my part.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.