LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-28-2016, 09:49 AM   #1
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
AWS sudo yum fail, but not while as root


Hello, got an AWS machine. All works well with root, if I run yum update, but while using ansible or just logged in with a normal user and running: sudo yum update, it fails with:

Code:
Connection timed out after 100000 milliseconds
Does anybody know how to fix this or why does it happen?

NOTE: I use some AWS proxy for http/https which is setup in /etc/profile.d/proxy.sh and its accessible by all users.
 
Old 12-28-2016, 10:29 AM   #2
bbuske
Member
 
Registered: Dec 2016
Location: Venezuela
Distribution: Manjaro
Posts: 109

Rep: Reputation: 15
If it works as root, the issue is most likely related to the user account.

1. Have you made sure, that the user account does have permissions to run sudo?
2. Have you made sure, that indeed all users have access to the proxy?
3. Did you try with a different user?

Looks like, whenever you try to connect with a regular user, the connection fails. I am fairly sure that the connection is the issue, because I suppose if it was for missing sudo permissions, you would get an access denied error and not just the connection timing out.

Unfortunately I am not too familiar with AWS - I will consult with a fellow Linux tech, who does work with this kind of stuff and see if he has an answer.
 
Old 12-28-2016, 10:36 AM   #3
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by bbuske View Post
If it works as root, the issue is most likely related to the user account.

1. Have you made sure, that the user account does have permissions to run sudo?
2. Have you made sure, that indeed all users have access to the proxy?
3. Did you try with a different user?

Looks like, whenever you try to connect with a regular user, the connection fails. I am fairly sure that the connection is the issue, because I suppose if it was for missing sudo permissions, you would get an access denied error and not just the connection timing out.

Unfortunately I am not too familiar with AWS - I will consult with a fellow Linux tech, who does work with this kind of stuff and see if he has an answer.
1. Yes, otherwise I would get a different kind of error
2. Yes, doing echo $http_proxy, works for all users
3. Yes, 2 users in fact

Actually, if I try manually to download the repomd.xml file from the failed repo, I can do it as a normal user.
 
Old 12-29-2016, 05:54 AM   #4
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
Found the issue, seems that sudo didn't export everything, so adding following line to sudoers file:

Code:
Defaults    env_keep += "http_proxy https_proxy no_proxy NO_PROXY"
fixed the issue.
 
Old 12-29-2016, 10:28 AM   #5
bbuske
Member
 
Registered: Dec 2016
Location: Venezuela
Distribution: Manjaro
Posts: 109

Rep: Reputation: 15
Glad you got it fixed.
Also good that you have shared your solution. Sorry I could not be of more help. AWS really isn't my strong point.
 
Old 12-29-2016, 12:11 PM   #6
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by bbuske View Post
Glad you got it fixed.
Also good that you have shared your solution. Sorry I could not be of more help. AWS really isn't my strong point.
This is not AWS issue, this was a stupid sudo setup issue.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL 7.2 / AWS EC2 - yum-cron missing sseaney Red Hat 5 02-05-2016 12:50 AM
sudo: effective uid is not 0, is sudo installed setuid root? awladnas Linux - Newbie 10 08-30-2014 06:03 PM
Question about the sudo command, specifically how to have sudo act as if user is root slacker_ Linux - Newbie 17 09-22-2013 03:48 PM
[SOLVED] sudo yum via proxy doesnt resolve hosts but can is run as root crawshaws Linux - Newbie 1 08-15-2012 12:02 PM
Can't use sudo, only account that's not root is not a sudo'ers [Ubuntu 9.10] randyriver10 Linux - Desktop 1 01-09-2010 07:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration