Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- if [ $# -ne 1 ]; then
- echo "Please enter username."
- else
- USERNAME=$1
- PASSWD=$USERNAME
- HOME=/home/$USERNAME
- BIN_PATH=$HOME/bin
- echo "adding user: [$USERNAME]"
- useradd -m -s /bin/rbash $USERNAME
- echo $USERNAME:$PASSWD | chpasswd
- #make password expire
- passwd -e $USERNAME
- chown root:$USERNAME $HOME/.bashrc $HOME/.bash_profile
- chmod 640 $HOME/.bashrc $HOME/.bash_profile
- mkdir $BIN_PATH
- echo "export PATH=$BIN_PATH" >> $HOME/.bash_profile
- ln -s /usr/bin/ssh $BIN_PATH/ssh
- echo "done!"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement