關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • FreeBSD 新增/更改用戶密碼 Shell Script

    Posted on June 5th, 2009 Sam Tang No comments

    在 FreeBSD 下可以用以下非互動方法新增用戶或修改用戶密碼:

    新增使用者: (使用者名稱為 new_user,密碼為 new_pass)

    # echo topSecrete | pw add user vivek -h 0

    更改現有使用者密碼:

    # echo newPassword | pw mod user user_name -h 0

    只要用以上指令,便可以編寫新增及更改用戶密碼的 shell script。


    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word