Skip to content

Instantly share code, notes, and snippets.

@aduartem
Created October 8, 2016 20:10
Show Gist options
  • Save aduartem/16dfa7b44033e38b327eef0667974d53 to your computer and use it in GitHub Desktop.
Save aduartem/16dfa7b44033e38b327eef0667974d53 to your computer and use it in GitHub Desktop.
Herramienta para crear usuario en Debian
#!/bin/bash
# Autor: Andrés Duarte M.
# Crear usuario en linux
echo "Ingresa nombre de usuario:"
read user
useradd $user
passwd $user
userDir="/home/"$user
echo "Creando directorio de usuario "$userDir
mkdir $userDir
chown $user":"$user -R $userDir
chmod 755 -R $userDir
usermod -d $userDir $user # Asignar el directorio de usuario al nuevo usuario
nano /etc/passwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment