Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8198937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:04:06+00:00 2026-06-07T06:04:06+00:00

I developed a tool to send one-line commands to different linux machines in one

  • 0

I developed a tool to send one-line commands to different linux machines in one shot using JSch (A java library used to communicating with other machines over ssh)

So our client needs to change the password on ALL machines. Google helped me reach this point:

echo -e "123\n123" | passwd username
Where ‘123’ is the new password.

The command executes but this is ALWAYS the output:

[root@QNA-XR1 ~]# echo -e "123\n123" | passwd
Changing password for root
New password:
Retype password:
passwd: password for root is unchanged

Which indicates that the command didn’t succeed.

Please note that this is an small device with linux running on it. It’s a privately compiled version to be as compact as possible. I don’t know much about linux actually !

This is the machines info:

[root@QNA-XR1 ~]# uname -a
Linux QNA-XR1 2.6.22-XR100-v1.1.7 #1 Tue Aug 19 22:55:50 EDT 2008 ppc unknown

passwd help:

[root@QNA-XR1 ~]# passwd --help
BusyBox v1.7.3 (2008-01-09 00:06:30 EST) multi-call binary

Usage: passwd [OPTION] [name]

Change a user password. If no name is specified,
changes the password for the current user.

Options:
        -a      Define which algorithm shall be used for the password
                (choices: des, md5)
        -d      Delete the password for the specified user account
        -l      Locks (disables) the specified user account
        -u      Unlocks (re-enables) the specified user account

echo help

[root@QNA-XR1 ~]# help echo
echo: echo [-neE] [arg ...]
    Output the ARGs.  If -n is specified, the trailing newline is
    suppressed.  If the -e option is given, interpretation of the
    following backslash-escaped characters is turned on:
        \a      alert (bell)
        \b      backspace
        \c      suppress trailing newline
        \E      escape character
        \f      form feed
        \n      new line
        \r      carriage return
        \t      horizontal tab
        \v      vertical tab
        \\      backslash
        \num    the character whose ASCII code is NUM (octal).

    You can explicitly turn off the interpretation of the above characters
    with the -E option.

Thanks a lot in advance for you help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:04:07+00:00Added an answer on June 7, 2026 at 6:04 am

    /bin/passwd may be opening /dev/tty to force reading from a terminal instead of a pipe.

    You may be better off encrypting (hashing, really) your new password using crypt(), and then replacing the password hash in /etc/shadow (for systems that have it) or /etc/passwd (for systems that don’t). This has the disadvantage of being somewhat OS-dependent, but it doesn’t get into weird tty games.

    You might also be able to force allocation of a tty in ssh – ssh can operate both with or without one. Then you would add a couple of delays before sending the password in plaintext twice – this method is less OS-dependent, but tty games can be less than fun sometimes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I developed a Windows command line tool using C, and compiled it in VC++,
Can you recommend a simple/best tool for an web application developed using Wicket framework?
i want to know the best opensource network monitoring tool developed in java with
We developed a project in java using netbeans.In that we use bouncycastle (.java classes
I've developed a simple xmpp chat client (for Android, using asmack library). Now, I
I've picked up a legacy application developed in C/C++ on Linux, using ncurses for
I have a web tool developed, which uses node.js and socket.io. it's a one
I've developed a command line tool which converts some kind of binary data to
I've developed a web part using the wspbuilder tool (Web part with feature). When
We have a mass emailing tool (.net based) that we developed in house. html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.