Sudo: a terminal is required to read the password;

Hello, when i try and add KVM instance i cannot get past this error:
when i used centos it was fine.
I guess i could use SSH key but i havent figured it out yet, any help would be appreciated

SYSTEM INFORMATION
OS type and version Ubuntu 20.04
Webmin version 1.994
Cloudmin version 9.6 PRO

You need to be at a terminal with root access. If you’re on a user account on Virtualmin and using the terminal window from the menu, it doesn’t have root access.

Its Cloudmin, and its supposed to work automated with WHMCS, i cant even do it manually.

Hello @Sinisha82 , this is from the community guidelines:

Tell us the actual error and include a few relevant lines from the applicable log (maillog or access log or error log, most likely).

See Forum Guidelines: Please read before posting!

Your most recent post (as well as a few of your other posts in the recent past) reflect an attitude that you tell us how Cloudmin / Virtualmin / Webmin falls short of your expectations, however unfounded these may be about how Cloudmin is supposed to work, and it becomes the job of the community to convince you otherwise. That is not how this works.

Please follow the community guidelines and provide relevant snippets from logs - and even screenshots, if they help illustrate the issue better - to enable the community to help you install and use this free, open-source software which has a long and proven history of success and an existing global user base which has been able to use it in production environments via the documentation that is available online.

Please follow the community guidelines. Thanks.

the error is sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
i understand i cant use ssh username and password.
therefore i created ssh key which i have installed on the second server.
no matter what i do i cannot add this newly created key to cloudmin ssh key, i tried pasting, selecting file /id_rsa i keep getting this error Failed to save SSH key : Existing key file does not contain an SSH key.

what can i do next?

That’s the private key. I still don’t understand what you’re doing or where you’re doing it, exactly, but the way ssh keys work is like this:

  1. Create a public/private key pair on the system you want to be able to connect from.
  2. Copy the public key to the system you want to be able to connect to in the /root/.ssh/authorized_keys file (or whatever user you’re trying to connect as). The private key generally never leaves the system it is generated on.

So, when I see you saying you’re copying id_rsa, I assume that’s what you’re doing wrong, because that’s not a file you copy (unless it’s your personal key and you want to take it with you to a new computer).

vultr have some good docs on SSH key

I like PuTTYgen, GUI

Make sure that if you’re using putty to generate keys, you export to the openssh compatible format (I have no idea what the native putty format is for, since it doesn’t work on any system I’ve ever managed).

Hi Joe,
Im sorry if i am not very clear, i did mention at the start of post i am trying to create KVM instance in cloudmin, if you look at the short paragraph in cloudmin documentation i was simply trying to follow the steps below

  1. Go to Cloudmin SettingsSSH Keys, and click on Add a new SSH key.
  2. Fill in the Key description field, and enter the path to the private key file into the In existing file box, such as /root/.ssh/id_rsa
  3. Change the Add to root’s authorized keys field to Yes.
  4. Click the Create button.

Alternately, you can have Cloudmin generate a new key or use one that you paste in on that same form.

When i generate via cloudmin, the key doesnt work and there isnt enough information where this key is stored and what to do next, how do i make that Cloudmin generated key work?
This is the error i am getting at the moment
Checking SSH login …
… SSH connection failed : Login failed ( The authenticity of host ‘192.168.50.10 (192.168.50.10)’ can’t be established. ECDSA key fingerprint is SHA256:2mYd21PcZXgZGXz+NG56OCnNkLLxy9JPm5uRJ8lwDLEc. /[fingerprint])? Warning: Permanently added ‘192.168.50.10’ (ECDSA) to the list of known hosts. Permission denied, please try again. )

Hi Joe, i did all that, and the key works i can ssh via terminal no issues to the other server
but problem is in cloudmin (ssh keys–add ssh key) when i try and add that key for authentication, it keeps giving error-- Failed to save SSH key : Existing key file does not contain an SSH key.
which key should i choose in the cloudmin ?

I found a thread from 2013, same issue
Can’t add SSH private keys to CloudMin - Cloudmin - Virtualmin Community

one example
mlbarrow

Jan '14

I ran into this problem as well using Cloudmin GPL (7.4.kvm) and removing those lines did not work for me.

I looked at the code (server-manager-lib-funcs.pl, check_ssh_key_data) and it looks like the issue is the regexp back match: $3 should be $4. I made the patch to my local copy and I can now add a private key properly via upload or pasting it in.

But there seems to be a larger issue here. It appears that the first key generated MUST either be generated by Cloudmin or be a private key. Once one gets over that hurdle, one can add public keys that get added to newly-created VMs (which was my original intent). Is that a bug in the code, UI, or an issue with my understanding?

hey mate, you quoted me?! i don’t understand!

would be awesome if you could help me fix this issue as soon as possible. Thanks

if anyone else comes across this issue using Ubuntu or Debian, solution is enable root login in ssh config file.
Thanks Jamie

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.