1

Getting knife bootstrap error on ubuntu chef node

$ knife bootstrap 52.8.178.221 -x ubuntu -i ~/Keys/chef1.pem

mkdir: cannot create directory ‘/etc/chef’: Permission denied
52.8.178.221 bash: line 35: /etc/chef/validation.pem: No such file or directory
52.8.178.221 chmod: cannot access ‘/etc/chef/validation.pem’: No such file or directory
52.8.178.221 mkdir: cannot create directory ‘/etc/chef’: Permission denied
52.8.178.221 bash: line 68: /etc/chef/trusted_certs/ashishk.crt: No such file or directory
52.8.178.221 bash: line 95: /etc/chef/client.rb: No such file or directory
52.8.178.221 bash: line 104: /etc/chef/first-boot.json: No such file or directory
52.8.178.221 Starting first Chef Client run...
52.8.178.221 bash: line 110: chef-client: command not found

user on chef-node should have sudo permissions so i added

# User privilege specification
root    ALL=(ALL:ALL) ALL
ubuntu  ALL=(ALL:ALL) ALL

still getting error :

mkdir: cannot create directory ‘/etc/chef’: Permission denied

Ashish Karpe
  • 2,557
  • 3
  • 20
  • 24

1 Answers1

3

Got the solution "--sudo --use-sudo-password" helped doing it !

$knife bootstrap  52.8.178.221 -x ubuntu -i ~/Keys/chef1.pem --sudo --use-sudo-password
Ashish Karpe
  • 2,557
  • 3
  • 20
  • 24