Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
NetInfo and password creation
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mhaury" data-source="post: 57924"><p><strong>OSX 10.3 Password on CommandLine - A Solution</strong></p><p></p><p>Hello,</p><p></p><p>this script creates a password on the commandline, however you have to use 'expect' to create the password via:</p><p>passwd -i netinfo username</p><p></p><p>You can either run directly an expect script or wrap it with zsh...</p><p></p><p>I pass the parameters via the command line</p><p>------ start script</p><p>#!/bin/zsh</p><p>username=$1</p><p>password=$2</p><p></p><p>expect<<EOF</p><p>spawn "passwd -i netinfo" $username</p><p>expect "ssword:"</p><p>send $password\r</p><p>expect "ssword:"</p><p>send $password\r</p><p>expect eof</p><p>EOF</p><p>------ end script</p><p></p><p>Hope that helps... I lost about 2 days to find this out....</p><p></p><p>Best M.</p></blockquote><p></p>
[QUOTE="mhaury, post: 57924"] [b]OSX 10.3 Password on CommandLine - A Solution[/b] Hello, this script creates a password on the commandline, however you have to use 'expect' to create the password via: passwd -i netinfo username You can either run directly an expect script or wrap it with zsh... I pass the parameters via the command line ------ start script #!/bin/zsh username=$1 password=$2 expect<<EOF spawn "passwd -i netinfo" $username expect "ssword:" send $password\r expect "ssword:" send $password\r expect eof EOF ------ end script Hope that helps... I lost about 2 days to find this out.... Best M. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
NetInfo and password creation
Top