Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:51:53+00:00 2026-06-04T13:51:53+00:00

Overall I am trying to inject key presses into the Ubuntu login screen from

  • 0

Overall I am trying to inject key presses into the Ubuntu login screen from a separate shell. I have the machine (running Ubuntu 10.04) at the standard login screen and I am SSH’d into the machine as well. I’ve tried the following (from the SSH shell):

$ ps ax | grep X
 2844 tty8     Ss+    0:01 /usr/bin/X :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-Gp2Rlq/database
$ export DISPLAY=:0
$ xdotool key Return
No protocol specified
Error: Can't open display: :0
Failed creating new xdo instance

This exact same method works once the machine is logged into Ubuntu, but it does not work for the login screen.

Ideally, I want to be able to finish the login from another shell. I do NOT want to use automatic login. I just want to be able to grab the correct display, and execute the key presses necessary to login.

Any help would be greatly appreciated.

Edited:

Thanks to the tip from n.m. I was able to get this working with:

export DISPLAY=:0
sudo xdotool key Return

This accomplishes what I wanted, but now I am wondering if there is a way to accomplish this without ‘sudo’? Is there a flag I can enable/disable to get around this?

Thanks again for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:51:55+00:00Added an answer on June 4, 2026 at 1:51 pm

    You need authority to connect to the display. Note the -auth parameter to the X command. That’s where the authority is.

    Try this:

    export XAUTHORITY=/var/run/gdm/auth-for-gdm-<whatever-it-is>/database 
    export DISPLAY=:0 
    xdotool key Return
    

    You need to be root to be able to access the authority file.

    See man xauth for (a lot) more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to calculate the overall CPU utilization of a single CPU, Ubuntu
I am trying to build my overall expertise in C++ coming from VBA, so
I'm trying to extract the overall comments number from a web page using Jsoup.
The overall goal I'm trying to accomplish is to implement a customizable avatar system
I'm trying to use RichFaces <rich:fileUpload> component (with Seam as the overall framework) to
I am trying to display overall ratings on the front of my site and
I am trying to write a PHP script that retrieves an xml file from
I've been trying to find some guidelines on the overall process for releasing an
New to java. Trying to familiarize myself with syntax and overall language structure. I
I'm trying to echo the key of a custom field (value, such as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.