The password is failed to login because special character symbol like “$”(dollar sign) is considered to be special character in Linux.
drush upwd USERNAME --password="PASSWORD"
This command is actually running for Linux in which some special characters always needs to be escaped with “\”. So if you try the password:
drush upwd root --password="S$1gma"
The above password will never work, to make the above password work you need to escape it in Linux like:
drush upwd root --password="S\$1gma"
Of course the new password now is S$1gma but this is the way how bash deals with some characters.
So either you escape all the special characters in your string or use some SAFE SET of characters like [,._+:@%/-] which don't need to be escaped.
For Drupal 7 :
drush vset maintenance_mode 1 // To take website into maintenance mode drush vset maintenance_mode 0 // To take website into live mode
For Drupal 6 :
drush vset site_offline 1 // To take website into maintenance mode drush vset site_offline 0 // To take website into live mode