I am using puppet to manage ssh keys, it works fine all but one system, which its a true RHEL6 (vs CentOS and Amazon distos) (Puppet 3.1.1). Not sure even sure where to look to troubleshoot the issue. I have disabled selinux for testing too. Any suggestions would be greatly appreciated. Here is the manifest snipplet Using viurtal user and heria $user = hiera($title,nil,"${environment}/user") ssh_authorized_key { $title: ensure => ''present'', type => ''ssh-rsa'', key => $user[''sshkey''], user => $title, require => User[$title], name => "${title}@myvbo.net", } And the errors from the puppet run. Puppet (err): Puppet::Util::FileType::FileTypeFlat could not write /home/jsmith/.ssh/authorized_keys: cannot generate tempfile `/puppet20130331-3128-n19xxm-9'' Tue Apr 02 12:42:33 +0000 2013 /Stage[main]/User::Users/User::Virtual[jsmith]/Ssh_authorized_key[elondon] (err): Could not evaluate: Puppet::Util::FileType::FileTypeFlat could not write /home/jsmith/.ssh/authorized_keys: cannot generate tempfile `/puppet20130402-3219-n91x6m-9'' -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Joshua Hoblitt
2013-Apr-02 16:06 UTC
Re: [Puppet Users] ssh_authorized_key errors in RHEL6
Hello, On 04/02/2013 07:44 AM, Kubes wrote:> cannot generate tempfile `/puppet20130331-3128-n19xxm-9''I suspect this is the crux of your issue. Is there a /tmp on that system and is it world writable? Have you declared $TMPDIR? What does the puppet.conf look like on that system? Does `mktemp` work as expected? Eg. $ mktemp /tmp/tmp.7rj9E3NgP1 $ ls -la /tmp/tmp.7rj9E3NgP1 -rw------- 1 jhoblitt users 0 Apr 2 09:04 /tmp/tmp.7rj9E3NgP1 -Josh -- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Thanks Josh chmoding 777 /tmp fixed the issue. mktemp worked fine as root, not as a user, until chmod. Does puppet sudo for sshkeys, etc? puppet is running as root. On Tuesday, April 2, 2013 12:06:52 PM UTC-4, Joshua Hoblitt wrote:> > Hello, > > On 04/02/2013 07:44 AM, Kubes wrote: > > cannot generate tempfile `/puppet20130331-3128-n19xxm-9'' > > I suspect this is the crux of your issue. Is there a /tmp on that > system and is it world writable? Have you declared $TMPDIR? What does > the puppet.conf look like on that system? Does `mktemp` work as > expected? Eg. > > $ mktemp > /tmp/tmp.7rj9E3NgP1 > $ ls -la /tmp/tmp.7rj9E3NgP1 > -rw------- 1 jhoblitt users 0 Apr 2 09:04 /tmp/tmp.7rj9E3NgP1 > > -Josh > > -- >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
The permissions of /tmp should be 1777 so that all users can create files but the sticky bit is set. Setting the sticky bit ensures that files and directories under /tmp can only be renamed or deleted by the user that owns them. - Keith On 3 April 2013 00:41, Kubes <pkubat.mlist@freepricealerts.com> wrote:> Thanks Josh > > chmoding 777 /tmp fixed the issue. > > mktemp worked fine as root, not as a user, until chmod. Does puppet sudo > for sshkeys, etc? puppet is running as root. > > > > > > > > On Tuesday, April 2, 2013 12:06:52 PM UTC-4, Joshua Hoblitt wrote: >> >> Hello, >> >> On 04/02/2013 07:44 AM, Kubes wrote: >> > cannot generate tempfile `/puppet20130331-3128-n19xxm-**9'' >> >> I suspect this is the crux of your issue. Is there a /tmp on that >> system and is it world writable? Have you declared $TMPDIR? What does >> the puppet.conf look like on that system? Does `mktemp` work as >> expected? Eg. >> >> $ mktemp >> /tmp/tmp.7rj9E3NgP1 >> $ ls -la /tmp/tmp.7rj9E3NgP1 >> -rw------- 1 jhoblitt users 0 Apr 2 09:04 /tmp/tmp.7rj9E3NgP1 >> >> -Josh >> >> -- >> > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.