diff --git a/add-sftp.sh b/add-sftp.sh index 30e7054..6d9dbd1 100644 --- a/add-sftp.sh +++ b/add-sftp.sh @@ -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"