Ask Your Question

Sudo commands are very slow in VM [closed]

asked 2017-05-10 04:21:08 -0600

sanjana gravatar image

I have launched an instance running ubuntu in openstack. As the default login for the image is "ubuntu" i use a key-pair to login to the instance.

ssh -i key.pem ubuntu@10.x.x.x

however when i run any command that requires sudo permission it takes more than a minute to get executed. What could be the reason to this issue? I tried creating another user, so that i can log into the system as that user with the login and password. But sadly, even that does not work. I created another user 'abc' and entered password 'xxx' when i try ssh abc@10.x.x.x it gives, permission denied(public key) error.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sanjana
close date 2017-05-10 05:58:09.672509


Perhaps sudo spends a lot of time waiting for hostname resolution. There are quite a few articles on the internet about this.

Bernd Bausch gravatar imageBernd Bausch ( 2017-05-10 04:35:25 -0600 )edit

You are unable to log on as user abc because the SSH daemon doesn't permit password login. You can give abc a key, or allow password login in /etc/ssh/sshd_config.

Bernd Bausch gravatar imageBernd Bausch ( 2017-05-10 04:36:09 -0600 )edit

@Bernd Bausch thanks for the reply. Hostname resolution solved this issue

sanjana gravatar imagesanjana ( 2017-05-10 04:59:32 -0600 )edit

1 answer

Sort by » oldest newest most voted

answered 2017-05-10 04:32:51 -0600

Micha gravatar image

This could be because of a missing connection to the openstack dns service. Installing and enabling dnsmasq could help, since the name resolution for your hostname will then happen locally. You may need to add the hostname to the /etc/hosts.

For the ssh password login you need to set PasswordAuthentication yes in /etc/ssh/sshd_config

edit flag offensive delete link more


could you please tell me the steps for ssh password login. Where exactly do i need to make these changes? in my host or the instance which i want to access?

sanjana gravatar imagesanjana ( 2017-05-10 05:01:07 -0600 )edit

On the instance you want to access. Change PasswordAuthentication to yes and restart the ssh service via systemctl restart ssh or service ssh restart.

Micha gravatar imageMicha ( 2017-05-10 05:17:15 -0600 )edit

when i do a service ssh restart, it prompts for the password for defaulkt login user ubuntu. What should i enter?

sanjana gravatar imagesanjana ( 2017-05-10 05:38:39 -0600 )edit

Execute the command with sudo or allow passwordless sudo for this account.

I do not want to sound rude, but you are not really familiar with linux, aren't you? Maybe you should try to get used to this environment before using OpenStack.

Micha gravatar imageMicha ( 2017-05-10 05:41:15 -0600 )edit

@Micha perhaps i am comfortable with linux. Maybe my comment wasn't clear. When i try to restart the command with sudo, it does prompt me to re-enter the password and that was what i was talking about. In multiple places when i run any command with sudo, it re-prompts for the password.

sanjana gravatar imagesanjana ( 2017-05-10 05:46:07 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-05-10 04:21:08 -0600

Seen: 916 times

Last updated: May 10 '17