Removed sudo su

main
tony 2023-10-30 04:47:24 +00:00
parent 0b1d1add19
commit 1184e6b0d0
1 changed files with 1 additions and 9 deletions

View File

@ -12,8 +12,7 @@ if id "$USERNAME" &>/dev/null; then
exit 1
fi
# Become root and Create user
sudo su
# Create user
useradd -m -d $ROOT_DIRECTORY $USERNAME
if [ $? -ne 0 ]; then
echo "Failed to create user $USERNAME."
@ -30,10 +29,3 @@ chmod 775 $ROOT_DIRECTORY
# Get the hostname
HOSTNAME=$(hostname -f)
# Print the credentials
echo "SFTP User Created Successfully!"
echo "Username: $USERNAME"
echo "Password: $PASSWORD"
echo "SFTP Host: $HOSTNAME"
echo "Port: 22"