Cannot perform an interactive login from a non TTY device

0 votes
I'm getting the error "Cannot perform an interactive login from a non-TTY device." Can anyone suggest how to fix this?
Oct 17 in AWS by Priyanka
• 2,940 points
89 views

1 answer to this question.

0 votes

I also got the error 'Cannot perform an interactive login from a non-TTY device.' I fixed the issue this way, and I am sharing all possible different methods to resolve it.

1: Use Non-Interactive Methods

If you're trying to avoid interaction in an automation or script, you can configure AWS credentials instead of logging in each time.

Steps:

  1. Run aws configure in the terminal.

  2. Enter your Access Key ID, Secret Access Key, region, and output format.

  3. Credentials are saved, and you won't need an interactive login for future commands.

2: Force a TTY (for SSH scenarios)

If you're using SSH and need an interactive session, you can force the use of a terminal with the—t flag.

Steps:

  1. Use ssh -t user@hostname.

  2. The -t flag forces an interactive terminal session.

  3. You can now execute interactive commands remotely.

3: Running Docker Containers

When running Docker containers and facing this issue, make the container interactive using the -it flag.

Steps:

  1. Run docker run -it <container-name>.

  2. This opens an interactive terminal inside the Docker container.

4: CI/CD Pipelines

In CI/CD pipelines (like Jenkins), use environment variables instead of interactive logins.

Steps:

  1. Set environment variables:

    • AWS_ACCESS_KEY_ID=your_access_key

    • AWS_SECRET_ACCESS_KEY=your_secret_key

    • AWS_DEFAULT_REGION=your_region

  2. These are non-interactive and work well in automated environments.

answered Oct 24 by Tanushree

Related Questions In AWS

0 votes
0 answers

Cannot perform an interactive login from a non TTY device

Oct 10 in AWS by Priyanka
• 2,940 points
94 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

Create an S3 bucket in a specific region from the command line.

Hi@akhtar, You can use LocationConstraint in your command. ...READ MORE

answered Oct 7, 2020 in AWS by MD
• 95,460 points
2,669 views
+2 votes
2 answers

How do we move a domain from Hostgator to AWS Route 53?

I found this  Before transferring a domain, make ...READ MORE

answered Aug 3, 2018 in AWS by Priyaj
• 58,020 points
5,901 views
0 votes
1 answer

Want to use an AWS Cognito User Pool without putting a password(for an easier approach)

Currently, AWS Cognito is not supporting passwordless ...READ MORE

answered May 4, 2018 in AWS by Cloud gunner
• 4,670 points
5,500 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP