이렇게 해 보세요
작성자 정보
- 도리 작성
- 작성일
컨텐츠 정보
- 1,536 조회
- 0 추천
- 목록
본문
passwd 명령어에 대해 알려면...
[root@mail root]# passwd --help
Usage: passwd [OPTION...] <accountName>
-d, --delete delete the password for the named account (root only)
-f, --force force operation
-k, --keep-tokens keep non-expired authentication tokens
-l, --lock lock the named account (root only)
-S, --status report password status on the named account (root only)
--stdin read new tokens from stdin (root only)
-u, --unlock unlock the named account (root only)
Help options:
-?, --help Show this help message
--usage Display brief usage message
이렇게 나오죠.. 옵션들중 찾아 보는거에요.
제가 테스트 해본결과 이렇게 하면 되요.
참고만 하세요
#!/bin/bash
if [ "$1" = "" -o "$2" = "" ]; then
echo " 사용법 : useradder 계정 계정비밀번호"
else
/usr/sbin/useradd $1
echo "$2" > /tmp/pw_tmp
passwd --stdin $1 < /tmp/pw_tmp
echo " 계정명 : $1 비밀번호 : $2" >> /root/bin/mailuser.dat
fi
이렇게 하면..
계정 생성 유틸리티 가 되져^^;
관련자료
-
이전
-
다음