Skip to content

Instantly share code, notes, and snippets.

@rus364
rus364 / add_user.sh
Created May 27, 2024 07:22
Add user to Debian or Ubuntu
#!/bin/bash
user="<user_name>"
key="<user_key>"
users_home=/home
sudoers_filename="99-transparent-sudoers"
dpkg-query -W sudo || apt update && apt install -y sudo
str=$(grep "PermitEmptyPasswords" /etc/ssh/sshd_config)
#!/usr/bin/env bash
# It is simple script for joining linux system to windows Active Directory domain.
# I haven't tested it after the last edit...
# Attention!!! This script can completely broken your system!
# You should not use it if you don't know what you are doing!
# Determining the system in which the script runs.
if [[ `cat /etc/centos-release | cut -d' ' -f4 | cut -d. -f1` = 7 ]]; then
os="CentOS 7"