Giter VIP home page Giter VIP logo

Comments (8)

bpg avatar bpg commented on August 9, 2024

Hi @Empty2k12 👋🏼

ssh [email protected] sudo /usr/bin/tee works.

I see you've configured username 'user' for SSH access, but the username argument is not specified in the provider's ssh config. So the provider is using the default username instead, i.e. the one that is configured in the provider block via var.PROXMOX_VE_USERNAME
As I see from the the debug log, that user is different, and most likely is not configured for sudo.

You'd need to add username = "user" to the ssh block in the provider config, and everything should work:

  ssh {
    agent    = true
    username = "user"
  }

Please let me know if it solves the issue.

from terraform-provider-proxmox.

Empty2k12 avatar Empty2k12 commented on August 9, 2024

Hello @bpg, thanks for your quick response. I have just renamed the user in this issue. The user is called gero. Adding username = "gero" (should not be necessary) does not solve the issue.

Actually, the permissions for the user gero are broader than required:

gero ALL=(ALL) NOPASSWD: ALL
gero ALL=(root) NOPASSWD: /sbin/pvesm
gero ALL=(root) NOPASSWD: /sbin/qm
gero ALL=(root) NOPASSWD: /usr/bin/tee /var/lib/vz/*

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

Interesting... 🤔 Do you have the same user set up in the same way on all nodes in your PVE cluster?

from terraform-provider-proxmox.

Empty2k12 avatar Empty2k12 commented on August 9, 2024

Yes, I have.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

That really puzzles me. Could you check the syslog on your node, perhaps we can find some clues in there. For example, on my test node I have these logs from the snippet upload:

May 02 20:44:03 pve sshd[1894819]: Accepted key ED25519 SHA256:ciWV4gSYzOwR7dxeBWt/UZq5dF2qXoJOeT8SFQzJFDM found at /home/terraform/.ssh/authorized_keys:1
May 02 20:44:03 pve sshd[1894819]: Accepted publickey for terraform from X.X.X.X port 63876 ssh2: ED25519 SHA256:ciWV4gSYzOwR7dxeBWt/UZq5dF2qXoJOeT8SFQzJFDM
May 02 20:44:03 pve sshd[1894819]: User child is on pid 1894830
May 02 20:44:03 pve sshd[1894830]: Starting session: command for terraform from X.X.X.X port 63876 id 0
May 02 20:44:03 pve sudo[1894833]: terraform : PWD=/home/terraform ; USER=root ; COMMAND=/sbin/pvesm apiinfo
May 02 20:44:03 pve sudo[1894833]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
May 02 20:44:03 pve sudo[1894833]: pam_unix(sudo:session): session closed for user root
May 02 20:44:03 pve sudo[1894837]: terraform : PWD=/home/terraform ; USER=root ; COMMAND=/usr/bin/tee /var/lib/vz/snippets/cloud-config.yaml
May 02 20:44:03 pve sudo[1894837]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
May 02 20:44:03 pve sudo[1894837]: pam_unix(sudo:session): session closed for user root
May 02 20:44:03 pve sshd[1894830]: Close session: user terraform from X.X.X.X port 63876 id 0

Also, what type of shell is configured for root on your node?

from terraform-provider-proxmox.

mattburchett avatar mattburchett commented on August 9, 2024

I just came across this same problem, and changing my shell back to bash from zsh seems to have solved the problem.

I have some pretty custom zsh configs, so I wouldn't be entirely surprised if my issue was there, but I am now curious if the OP was using a shell that isn't bash. 🙂

from terraform-provider-proxmox.

HaziFlorinMarian avatar HaziFlorinMarian commented on August 9, 2024

Thank you @mattburchett for your comment!
I faced same issue and yeah..this module is not fully compatible with ZSH.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

The requirement for the default root shell has been documented in #1329

from terraform-provider-proxmox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.