Report this

What is the reason for this report?

Inappropriate loctl for device

Posted on July 30, 2021

Connected Tutorial(This question is a follow-up to this tutorial):

How To Set Up a Remote Desktop with X2Go on Ubuntu 18.04

I get this prompt, no SSH key. I’m using the root password.

“Connection failed. mesg: ttyname failed: Inappropriate loctl for device”



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In root/.profile

  • Comment out mesg n || true
  • Add the following line: tty -s && mesg n

Heya,

To fix this, SSH into your server if you’re not already connected and edit /root/.profile with your preferred text editor.

$ nano /root/.profile

It probably looks like this at first:

# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

mesg n || true

We’ll just have to change the last line by adding tty -s && at the beginning of the last line. It should look like this:

# ~/.profile: executed by Bourne-compatible login shells.

  if [ "$BASH" ]; then
    if [ -f ~/.bashrc ]; then
      . ~/.bashrc
    fi
  fi

tty -s && mesg n || true

Save and close the file when you’re finished and try connecting to the server again. It should work without problems.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.