-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathredefinirusuario
More file actions
37 lines (36 loc) · 877 Bytes
/
redefinirusuario
File metadata and controls
37 lines (36 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
read -p "Nombre del usuario: " namer
if cat /etc/passwd |grep $namer: > /dev/null
then
echo " "
else
clear
echo "Usuario $namer no existe"
exit
fi
clear
echo -e "\033[1;33mOpciones a modificar ?\033[1;30m
1) Numero de logins
2) Fecha de expiracion
3) Cambiar contraseña del usuario"
read -p "opcion: " option
if [ $option -eq 1 ]; then
read -p "Cual es el nuevo numero de logins: " liml
limite $namer $liml
exit 0
fi
if [ $option -eq 2 ]; then
echo "Cual es la nueva fecha : formato AAAA/MM/DD"
read -p ": " date
chage -E $date $namer 2> /dev/null
echo -e "\033[1;31mUsuario $namer Fecha: $date\033[0m"
exit
fi
if [ $option -eq 3 ]
then
read -p "Cual es la nueva contraseña para $namer: " senha
(echo "$senha" ; echo "$senha" ) |passwd $namer > /dev/null 2>/dev/null
echo "$senha" > /etc/VpsPackdir/senha/$namer
echo "Nueva contraseña aplicada"
exit
fi