Hello, I have a bash script named newpw I got from another forum:
it executes as newpw knoppix 123456 where 123456 is the new password
#!/bin/bash
# \
exec expect -f "$0" ${1+"$@"}
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "assword:"
send "$password\r"
expect "assword:"
send "$password\r"
expect eof
It seems to execute OK when I chmod to 777 newpw. However the new password is not taking. When I try to ftp into the machine the only password that works is one I set up by executing passwd knoppix at the command line directly. Any ideas on how to get this to work? Thanks

Mini Computer Vacuum USB Keyboard Cleaner PC Laptop Brush Dust Cleaning Kit NEW
$13.89
KARDV Cordless Vacuum Cleaner, 500W/40Kpa Vacuum Cleaners for Home, 60Mins St...
$64.99
V3 Robot Vacuum and Mop Combo,Self-Charging,5000pa Strong Suction,WiFi/Alexa NIB
$82.00
Cordless Vacuum Cleaner for 20V Battery, 7-in-1 Lightweight Stick Vacu...
$149.15
Cordless Vacuum Compatible with Dewalt 18V Battery, Portable Handheld Vacuum Cle
$81.90
US Mini Computer Vacuum USB Keyboard Cleaner PC Laptop Brush Dust Cleaning Kits
$13.89
Paladone USB Desk Vac Novelty Upright Mini Computer Vacuum Retro Vintage
$59.99
🔥 OEM Shark Cordless Vacuum Charger DK33-248080H-U for Shark Rocket
$18.75
Compressed Air Duster & Vacuum, 320000RPM Rechargeable Mini Electric Blower
$44.99
Trucozie Cordless Vacuum Cleaner, Self-Standing Lightweight Stick Vacuum New Ope
$89.00