You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by bhaisaab <gi...@git.apache.org> on 2015/05/22 15:39:23 UTC

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

GitHub user bhaisaab opened a pull request:

    https://github.com/apache/cloudstack/pull/288

    CLOUDSTACK-8339: Allow non-root users to add KVM host

    This allows non-root users to add KVM hosts, the user should be an admin or
    added to sudoers to execute sudo cloudstack-setup-agent.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/cloudstack CLOUDSTACK-8339

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/288.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #288
    
----
commit af3d42648dd5a905a5f30530ba66ab7becc24cdd
Author: Rohit Yadav <ro...@shapeblue.com>
Date:   2015-05-22T13:36:16Z

    CLOUDSTACK-8339: Allow non-root users to add KVM host
    
    This allows non-root users to add KVM hosts, the user should be an admin or
    added to sudoers to execute sudo cloudstack-setup-agent.
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105225663
  
    Thanks @remibergsma I'll merge it on both 4.5 and master. On master, I'll need to fix the packaging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab closed the pull request at:

    https://github.com/apache/cloudstack/pull/288


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by mlsorensen <gi...@git.apache.org>.
Github user mlsorensen commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105133656
  
    The issue now is that root credentials for the host are stored in the db, and even echoed back if you ask to list hosts with details. It's a huge step forward to have a single user who only has access to run cloudstack-setup-agent. Perhaps you don't have the same root everywhere, but you don't have to have the same non-root user/password everywhere, either. You can even remove/disable this user after the host is added.
    
    In addition, many places don't allow root to SSH as a basic infosec policy. 
    
    I'd like us to get out of the business of dictating  and conflicting with configuration management, where possible, including things suggested like changing passwords upon agent setup. These things will rub big shops who have their config management story together the wrong way, and we already do way too much (like touching iptables and libvirt settings) IMO. They also confuse newbies more than they help ("why can't I log in anymore?", and I've heard a lot of "why did my networking get screwed up and restart?" from the existing setups scripts).
    
    Also re: agent listening, I don't think  we want the agent to listen. It has been a huge boon to have all ports closed on the hypervisor except SSH, everywhere I've gone, from an infosec standpoint. I'm also not sure there's a meaningful gain by having the mgmt server contact the host via a listening agent port vs contacting the host via SSH and a user who has no access other than to run setup. I'm also more confident that SSH would pass a penetration test.
    
    An easy fix that I think would accommodate everyone at this point is to only use 'sudo' if the user passed in is not 'root'. Then everyone doing it the current way is unaffected by the sudo and requiretty, and people who want to only pass non-root credentials to cloudstack mgmt server can do that as well with a sudoers line for cloudstack-agent-setup and a -t for the sudo (or perhaps just document the requiretty along with the sudoers line).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105205213
  
    @bhaisaab Awesome, will give it a final test run soon!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105072838
  
    Thanks for reviewing everyone. Regarding the tty/sudo issue, I'll test and see if we can fix something in the agent post installation or setup scripts similar to what we do with the management server.
    
    While we can create a user 'cloud', it might be a case that sysadmins would want to use some other user they may have created manually or using ansible/chef/puppet etc and configure that user with suitable options in sudoers file. I like Remi's idea which I'll explore.
    
    Comments, thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105004714
  
    @bhaisaab Nice! The code LGTM, will give it a test-drive today or tomorrow


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105115006
  
    For now, I think the quick win is to make the proposed use of 'sudo' work, so that works what worked before (we require root credentials to add a host) and alternatively one can specify other credentials with proper sudo config pre-setup (which we should document properly). Then we can merge this PR. I actually think this is a great improvement!
    
    Next, let's discuss a redesign of the agent. I've heard many people doing all sorts of suggestions and I can think of some myself as well. It might even be part of a bigger architecture change. Let's use a new thread for that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by terbolous <gi...@git.apache.org>.
Github user terbolous commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105064856
  
    Why don't we make a dedicated user (be it 'cloud' or anything) during agent
    install time?
    
    Makes a lot more sense to me, than relying on the usage of 'root', albeit
    this PR is a step in the right direction.
    
    -- 
    Erik
    
    On Sun, May 24, 2015 at 11:25 PM, Rafael da Fonseca <
    notifications@github.com> wrote:
    
    > Silly me.. this is running as supplied user, not as cloud. I agree remi,
    > ssh -t is the better option :)
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/cloudstack/pull/288#issuecomment-105063069>.
    >



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by rsafonseca <gi...@git.apache.org>.
Github user rsafonseca commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105056903
  
    Hi @remibergsma 
    If you're running into the no tty issue, that will likely happen also for the other commands the management server tries to run.
    I'm using this file in /etc/sudoers.d in all environments:
    {code}
    Cmnd_Alias CLOUDSTACK = /bin/mkdir, /bin/mount, /bin/umount, /bin/cp, /bin/chmod, /usr/bin/keytool, /bin/keytool
    
    Defaults:cloud !requiretty
    
    cloud   ALL=(root) NOPASSWD:CLOUDSTACK
    {code}
    
    I believe this is the best way to resolve it for all distros/configs, as long as we depend on sudo



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105225393
  
    For documentation purposes: the PR is merged and commit is here in 4.5: https://github.com/apache/cloudstack/commit/d2b0c1a32b2d8719eafd6d4574de9a824d46d290


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by terbolous <gi...@git.apache.org>.
Github user terbolous commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105076586
  
    On Mon, May 25, 2015 at 12:50 AM, Rafael da Fonseca <
    notifications@github.com> wrote:
    
    > Creating a user for this use would be worse, because it would require some
    > sort of 'standard' credential for ssh access. Or it would require that such
    > account didn't have ssh access and supplied account would need to sudo su
    > account to use It to run the script.. so no advantage.
    >
    
    We do that already, by requiring the usage of 'root'.
    Wouldn't need to be anything standard, setting the password could be done
    during agent install, by asking or generating something random and printing
    it to stdout -- heck, the mgmt server could even change to something random
    during the first setup.
    
    
    > I think that the best way to tackle this would be to use the actual agent
    > for registration. Letting the agent startup without config and listen on
    > tcp port for remote registration (no ssh or sudo) and just process the
    > credentials sent and self configure.
    >
    
    The mgmt server tries to ssh and start the agent if it's registered down
    for some reason.
    
    -- 
    Erik



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105045696
  
    @bhaisaab, I tested your patch and ran to an issue where a TTY is required to run sudo, but not requested. The host cannot be added.
    
    Logs:
    ```
    2015-05-24 13:48:44,175 DEBUG [c.c.u.s.SSHCmdHelper] (ApiServer-8:ctx-0b7d379a ctx-5e04fa3a) sudo cloudstack-setup-agent  -m 192.168.22.61 -z 1 -p 1 -c 1 -g 57acd541-cd37-34ea-af6a-dc6ecd007325 -a --pubNic=cloudbr0 --prvNi
    c=cloudbr0 --guestNic=cloudbr0 --hypervisor=kvm output:sudo: sorry, you must have a tty to run sudo
    ```
    Because it always uses 'sudo' you cannot add a host as 'root' nor as other user. To test:
    
    ```
    [root@cs1 ~]# ssh root@kvm1 sudo whoami
    root@kvm1's password: 
    sudo: sorry, you must have a tty to run sudo
    ```
    
    Two possible solutions:
    1. Specify -t parameter or similar to request a TTY:
    
    ```
    [root@cs1 ~]# ssh -t root@kvm1 sudo whoami
    root@kvm1's password: 
    root
    Connection to kvm1 closed.
    ```
    
    I prefer this solution since we then solve it on the CloudStack side. Alternatively, one can remove the TTY requirement from /etc/sudoers file:
    
    ```
    Defaults    requiretty
    ```
    
    I've continued my tests with altering the /etc/sudoers file and then I can add the host as user 'root' again, and also as user 'cloud' that I added to the /etc/sudoers file to allow it root without a password.
    
    Result:
    
    ```
    [root@kvm2 ~]# ps aux | grep cloud
    root     23044  0.7  0.0 133128  4748 ?        Ss   14:03   0:00 sshd: cloud [priv]
    cloud    23048  0.0  0.0 133128  2216 ?        S    14:03   0:00 sshd: cloud@notty
    root     23062  0.0  0.0 188720  2588 ?        Ss   14:03   0:00 sudo cloudstack-setup-agent -m 192.168.22.61 -z 2 -p 2 -c 3 -g 57acd541-cd37-34ea-af6a-dc6ecd007325 -a --pubNic=cloudbr0 --prvNic=cloudbr0 --guestNic=cloudbr0 --hypervisor=kvm
    root     23073  0.8  0.1 199392  9740 ?        S    14:03   0:00 /usr/bin/python /bin/cloudstack-setup-agent -m 192.168.22.61 -z 2 -p 2 -c 3 -g 57acd541-cd37-34ea-af6a-dc6ecd007325 -a --pubNic=cloudbr0 --prvNic=cloudbr0 --guestNic=cloudbr0 --hypervisor=kvm
    ```
    
    Could you see if you can add a TTY request to your 'sudo cloudstack-setup-agent' call?
    
    Apart from this: works-like-a-sharm :-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by rsafonseca <gi...@git.apache.org>.
Github user rsafonseca commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105063069
  
    Silly me.. this is running as supplied user, not as cloud. I agree remi, ssh -t is the better option :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by mlsorensen <gi...@git.apache.org>.
Github user mlsorensen commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105031461
  
    Oh, I see the original post mentions that!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by mlsorensen <gi...@git.apache.org>.
Github user mlsorensen commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105031405
  
    Note you still have to add a sudoers entry for the user to run cloudstack-setup-agent.
    
    https://cwiki.apache.org/confluence/display/CLOUDSTACK/Allow+non-root+user+to+add+KVM+hypervisor


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105173698
  
    I'm focussing on getting this sorted out so we can merge.
    
    @mlsorensen I like the idea of not changing anything in case the username is 'root'. 
    
    Did some reading on 'require tty' security implications and I'm quite sure it doesn't matter much in our case. We could as well just document it then.
    
    To wrap it up:
    - Let's make sure sudo is NOT prepended when the username equals 'root'. This way we ensure the current behaviour is unchanged and does not require sudo
    - Since we require a sudo config anyway, let's document it properly. The minimal version I tested (assuming a non-privileged user cloudstack, can be any user):
    
    ```
    cloudstack ALL=NOPASSWD: /usr/bin/cloudstack-setup-agent
    defaults:cloudstack !requiretty
    ```
    
    This removes the 'requiretty' only for the cloudstack user so it does not change anything for existing sudo configs. Once we agree, I'll take care of documenting it.
    
    @bhaisaab Could you implement sudo only if non-root user please? This would then be the only improvement before we can merge this PR. Let me know if I can help other than testing it again.
    
    Do we all agree this is a great step we can take now?
    
    Apart from this we can discuss other improvements. I just don't want that to stop this small improvement with great value.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105225714
  
    Merged on 4.5, so closing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Re: [GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by Rohit Yadav <ro...@shapeblue.com>.
Hi Remi,

I’m not sure why but sometimes the asfgit hook fails to close a PR. In that case I general ask the PR author to close it manually. I had manually closed the PR #288.

> On 25-May-2015, at 2:26 pm, Remi Bergsma <RB...@schubergphilis.com> wrote:
>
> Hi Rohit,
>
> Just merged your PR to 4.5 and the commit is shown here. LGTM.
> https://github.com/apache/cloudstack/commit/d2b0c1a32b2d8719eafd6d4574de9a824d46d290
>
> It’s just that your PR did not get closed. Is there anything I should have done to make this happen?
>
> Thanks for the advice.
>
> Regards,
> Remi
>
>
> On 25 May 2015, at 14:21, remibergsma <gi...@git.apache.org>> wrote:
>
> Github user remibergsma commented on the pull request:
>
>   https://github.com/apache/cloudstack/pull/288#issuecomment-105224256
>
>   @bhaisaab Tested with non-privileged user (now uses sudo) and with root user (does not use sudo) and both just add the host as one would expect.
>
>   As user 'cloudstack':
>   ```
>   May 25 07:29:00 kvm2 sshd[6938]: Accepted password for cloudstack from 192.168.x.x port 39542 ssh2
>   May 25 07:29:00 kvm2 sshd[6938]: pam_unix(sshd:session): session opened for user cloudstack by (uid=0)
>   May 25 07:29:03 kvm2 sudo: cloudstack : TTY=unknown ; PWD=/home/cloudstack ; USER=root ; COMMAND=/bin/cloudstack-setup-agent -m 192.168.x.x -z 2 -p 2 -c 3 -g 57acd541-cd37-34ea-af6a-dc6ecd007325 -a --pubNic=cloudbr0 --prvNic=cloudbr0 --guestNic=cloudbr0 --hypervisor=kvm
>   May 25 07:30:04 kvm2 sshd[6942]: Received disconnect from 192.168.22.61: 11: Closed due to user request.
>   May 25 07:30:04 kvm2 sshd[6938]: pam_unix(sshd:session): session closed for user cloudstack
>   ```
>   As user 'root':
>   ```
>   May 25 07:33:16 kvm2 sshd[7376]: Accepted password for root from 192.168.22.61 port 39543 ssh2
>   May 25 07:33:16 kvm2 sshd[7376]: pam_unix(sshd:session): session opened for user root by (uid=0)
>   May 25 07:34:21 kvm2 sshd[7376]: Received disconnect from 192.168.22.61: 11: Closed due to user request.
>   May 25 07:34:21 kvm2 sshd[7376]: pam_unix(sshd:session): session closed for user root
>   ```
>
>   Since you also confirmed it works as expected I'm now merging it. Thanks!
>
>   Please note: the PR is against 4.5, we also need to get this to master..
>
>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at infrastructure@apache.org<ma...@apache.org> or file a JIRA ticket
> with INFRA.
> ---

Regards,
Rohit Yadav
Software Architect, ShapeBlue
M. +91 88 262 30892 | rohit.yadav@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab



Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build<http://shapeblue.com/iaas-cloud-design-and-build//>
CSForge – rapid IaaS deployment framework<http://shapeblue.com/csforge/>
CloudStack Consulting<http://shapeblue.com/cloudstack-consultancy/>
CloudStack Software Engineering<http://shapeblue.com/cloudstack-software-engineering/>
CloudStack Infrastructure Support<http://shapeblue.com/cloudstack-infrastructure-support/>
CloudStack Bootcamp Training Courses<http://shapeblue.com/cloudstack-training/>

This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Shape Blue Ltd or related companies. If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error. Shape Blue Ltd is a company incorporated in England & Wales. ShapeBlue Services India LLP is a company incorporated in India and is operated under license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by The Republic of South Africa and is traded under license from Shape Blue Ltd. ShapeBlue is a registered trademark.

Re: [GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by Remi Bergsma <RB...@schubergphilis.com>.
Hi Rohit,

Just merged your PR to 4.5 and the commit is shown here. LGTM.
https://github.com/apache/cloudstack/commit/d2b0c1a32b2d8719eafd6d4574de9a824d46d290

It’s just that your PR did not get closed. Is there anything I should have done to make this happen?

Thanks for the advice.

Regards,
Remi


On 25 May 2015, at 14:21, remibergsma <gi...@git.apache.org>> wrote:

Github user remibergsma commented on the pull request:

   https://github.com/apache/cloudstack/pull/288#issuecomment-105224256

   @bhaisaab Tested with non-privileged user (now uses sudo) and with root user (does not use sudo) and both just add the host as one would expect.

   As user 'cloudstack':
   ```
   May 25 07:29:00 kvm2 sshd[6938]: Accepted password for cloudstack from 192.168.x.x port 39542 ssh2
   May 25 07:29:00 kvm2 sshd[6938]: pam_unix(sshd:session): session opened for user cloudstack by (uid=0)
   May 25 07:29:03 kvm2 sudo: cloudstack : TTY=unknown ; PWD=/home/cloudstack ; USER=root ; COMMAND=/bin/cloudstack-setup-agent -m 192.168.x.x -z 2 -p 2 -c 3 -g 57acd541-cd37-34ea-af6a-dc6ecd007325 -a --pubNic=cloudbr0 --prvNic=cloudbr0 --guestNic=cloudbr0 --hypervisor=kvm
   May 25 07:30:04 kvm2 sshd[6942]: Received disconnect from 192.168.22.61: 11: Closed due to user request.
   May 25 07:30:04 kvm2 sshd[6938]: pam_unix(sshd:session): session closed for user cloudstack
   ```
   As user 'root':
   ```
   May 25 07:33:16 kvm2 sshd[7376]: Accepted password for root from 192.168.22.61 port 39543 ssh2
   May 25 07:33:16 kvm2 sshd[7376]: pam_unix(sshd:session): session opened for user root by (uid=0)
   May 25 07:34:21 kvm2 sshd[7376]: Received disconnect from 192.168.22.61: 11: Closed due to user request.
   May 25 07:34:21 kvm2 sshd[7376]: pam_unix(sshd:session): session closed for user root
   ```

   Since you also confirmed it works as expected I'm now merging it. Thanks!

   Please note: the PR is against 4.5, we also need to get this to master..



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org<ma...@apache.org> or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105224256
  
    @bhaisaab Tested with non-privileged user (now uses sudo) and with root user (does not use sudo) and both just add the host as one would expect.
    
    As user 'cloudstack':
    ```
    May 25 07:29:00 kvm2 sshd[6938]: Accepted password for cloudstack from 192.168.x.x port 39542 ssh2
    May 25 07:29:00 kvm2 sshd[6938]: pam_unix(sshd:session): session opened for user cloudstack by (uid=0)
    May 25 07:29:03 kvm2 sudo: cloudstack : TTY=unknown ; PWD=/home/cloudstack ; USER=root ; COMMAND=/bin/cloudstack-setup-agent -m 192.168.x.x -z 2 -p 2 -c 3 -g 57acd541-cd37-34ea-af6a-dc6ecd007325 -a --pubNic=cloudbr0 --prvNic=cloudbr0 --guestNic=cloudbr0 --hypervisor=kvm
    May 25 07:30:04 kvm2 sshd[6942]: Received disconnect from 192.168.22.61: 11: Closed due to user request.
    May 25 07:30:04 kvm2 sshd[6938]: pam_unix(sshd:session): session closed for user cloudstack
    ```
    As user 'root':
    ```
    May 25 07:33:16 kvm2 sshd[7376]: Accepted password for root from 192.168.22.61 port 39543 ssh2
    May 25 07:33:16 kvm2 sshd[7376]: pam_unix(sshd:session): session opened for user root by (uid=0)
    May 25 07:34:21 kvm2 sshd[7376]: Received disconnect from 192.168.22.61: 11: Closed due to user request.
    May 25 07:34:21 kvm2 sshd[7376]: pam_unix(sshd:session): session closed for user root
    ```
    
    Since you also confirmed it works as expected I'm now merging it. Thanks!
    
    Please note: the PR is against 4.5, we also need to get this to master..



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by rsafonseca <gi...@git.apache.org>.
Github user rsafonseca commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105073554
  
    Creating a user for this use would be worse, because it would require some sort of 'standard' credential for ssh access. Or it would require that such account didn't have ssh access and supplied account would need to sudo su account to use It to run the script.. so no advantage.
    
    I think that the best way to tackle this would be to use the actual agent for registration. Letting the agent startup without config and listen on tcp port for remote registration (no ssh or sudo) and just process the credentials sent and self configure.
    
    I can work on this if you'd like :) 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105205488
  
    @remibergsma thanks, I tested locally and it seems to be working for me


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8339: Allow non-root users to ...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/288#issuecomment-105201247
  
    Thanks for commenting @mlsorensen @remibergsma 
    In the new fix we're maintaining old behavior for root users by not adding sudo, I've updated the install docs with Remi's sudoers config https://github.com/apache/cloudstack-docs-install/commit/1bf8b0b261f4e80b64450b1b002804e45b61a24b


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---