# Getting started tutorial question

**URL:** <https://forum.ansible.com/t/getting-started-tutorial-question/13017>\
**Category:** Ansible Project\
**Created:** [June 25, 2013, 8:10pm UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017 "2013-06-25T20:10:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Reagan](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@David\_Reagan](https://forum.ansible.com/u/David_Reagan)\
**Post date:** [June 25, 2013, 8:10pm UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/1 "2013-06-25T20:10:09Z")

</div>

In the [http://www.ansibleworks.com/docs/gettingstarted.html](http://www.ansibleworks.com/docs/gettingstarted.html) does it assume you have a valid ssh user set up on all your servers prior to running any playbooks?

I’ve set up a three node cluster via basic vagrant, and when I try to push a user to the other two nodes, it can’t. And the default vagrant user doesn’t have an id\_rsa file for me to copy onto the “master” vm. So, do I need to create a user on each VM with an ssh-key before I can run ansible?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 26, 2013, 2:29am UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/2 "2013-06-26T02:29:34Z")

</div>

You can SSH as root or any user other on the system, you do not need a user named ‘ansible’ or anything like that.

(I’d suggest learning Ansible first without vagrant, maybe)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [June 26, 2013, 2:31am UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/3 "2013-06-26T02:31:14Z")

</div>

You don’t need an ssh key, but you do need an existing user. sudo privileges might also be needed, like for adding more users. Another option is having a root ssh key. Many options, just chose the that suits you the most.

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [June 26, 2013, 2:46am UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/4 "2013-06-26T02:46:30Z")

</div>

David:

Doesn’t the vagrant user use the default vagrant private key with your vagrant box? (i.e., can you do "vagrant ssh to ssh into the instance)?

On my machine, that key is automatically installed in ~/.vagrant.d/insecure\_private\_key

Lorin

---

<div class="post-metadata">

**Author:** ![David\_Reagan](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@David\_Reagan](https://forum.ansible.com/u/David_Reagan)\
**Post date:** [June 27, 2013, 10:40pm UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/5 "2013-06-27T22:40:48Z")

</div>

You can’t ssh in as root on ubuntu since ubuntu disables the root account.

‘vagrant ssh vm’ works fine on my host. The issue is ssh’ing between vm’s. So a private key on my host doesn’t help much when I’m trying to do things between vm’s.

The default vagrant user has no password, or at least I don’t think it does, even though it has sudo access.

So it looks like I do need a user with sudo access and a password/sshkey on each vm. In addition to the one vagrant adds automatically.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![Greg\_Andrews](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@Greg\_Andrews](https://forum.ansible.com/u/Greg_Andrews)\
**Post date:** [June 27, 2013, 11:59pm UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/6 "2013-06-27T23:59:06Z")

</div>

Yes, but it's not a strong block on 10.04 or 12.04. The root account has  
its password disabled, but only in the ordinary way (equivalent to "passwd  
--lock"), and the sshd\_config file allows root logins. So you can create  
/root/.ssh/authorized\_keys (or maybe set a password) and ssh in as root.

It's usually better to give sudo privileges to another account than to ssh  
in as root. I just wanted to point out that it's possible.

&nbsp;&nbsp;-Greg

---

<div class="post-metadata">

**Author:** ![David\_Golden](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@David\_Golden](https://forum.ansible.com/u/David_Golden)\
**Post date:** [June 28, 2013, 1:31am UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/7 "2013-06-28T01:31:02Z")

</div>

In an automated config system where you don't habitually log in as  
root, I don't think it makes any difference. You're either running as  
root or you're running all commands with sudo. The privilege level is  
the same. The risk of key compromise is the same.

A sudo user helps save you from yourself if you're manually logged in  
and doing things.

David

---

<div class="post-metadata">

**Author:** ![kahlil.hodgson](https://avatars.discourse-cdn.com/v4/letter/k/b9bd4f/32.png) [@kahlil.hodgson](https://forum.ansible.com/u/kahlil.hodgson)\
**Post date:** [June 28, 2013, 1:43am UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/8 "2013-06-28T01:43:52Z")

</div>

sudo actions are logged.

if you have multiple admins, using ansible, this can be invaluable in tracking down issues.

K

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 28, 2013, 2:56am UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/9 "2013-06-28T02:56:40Z")

</div>

Ansible has some degree of logging it does itself, too, on the remote systems.

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [July 3, 2013, 5:42pm UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/10 "2013-07-03T17:42:52Z")

</div>

Is that documented anywhere? I opened a ticket because I couldn’t find a description of this in the docs: [https://github.com/ansible/ansible/issues/3431](https://github.com/ansible/ansible/issues/3431)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 3, 2013, 5:52pm UTC](https://forum.ansible.com/t/getting-started-tutorial-question/13017/11 "2013-07-03T17:52:21Z")

</div>

Probably not. Can of course be easily rectified 🙂
