This command always works regardless of the IAM permission
>aws sts get-caller-identity
you will get the output as
{
    "UserId": "################"
    "Account": "9876543221",
    "Arn": "arn:aws:iam::9876543221:user/content"
}
It uses error codes from 0-255 to specify the type of credentials
like 0 for success, 1 for S3 commands and 255 for command fail