Can iofogctl and controlplane be used with different username?

iofog-controller

(xiang zhou) #1

Hi,

I’m trying to follow the guide to deploy a remote controlplane from my desktop with different user name:
On my desktop, user ‘sjt’ is used and on remote server (10.200.210.36), user ‘xiangzhou’ is used

Below is yaml :

apiVersion: iofog.org/v2
kind: ControlPlane
metadata:
name: albatros
spec:
iofogUser:
name: Foo
surname: Bar
email: user@domain.com
password: iht234g9afhe
controllers:

  • name: alpaca-1
    host: 10.200.210.36
    ssh:
    user: xiangzhou
    keyFile: ~/.ssh/id_rsa

When deploying, I got an error msg : ‘✘ Error during SSH Session, Unable to successfully use sudo with user xiangzhou on this host.’

On the remote server ‘xiangzhou’ has the sudo right:
xiangzhou@whale:~$ sudo -l -U $USER
Matching Defaults entries for xiangzhou on whale:
env_reset, mail_badpass,
secure_path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

User xiangzhou may run the following commands on whale:
(ALL : ALL) ALL
(ALL : ALL) ALL

So questions are:

  1. which server does ‘this host’ refer to in the error msg ‘use sudo with user xiangzhou on this host’ ?
  2. If it refers to my local server, does it mean that I have to use the same user on local and remote control plane server ?
  3. If it refers to remote server, what could be wrong ? I have already added user ‘xiangzho’ to sudo group following the guide.

Thanks for any suggestions

Xiang


(Serge Radinovich) #2
  1. The host w/ address 10.200.210.36
  2. Refers to remote server.
  3. Could you show the contents of the visudo file and ensure that %sudo ALL=(ALL) NOPASSWD:ALL is present?

(xiang zhou) #3

Thanks so much for the quick respond. And you are right, the line you mentioned is missed. I added one line for use ‘xiangzhou’ following the same convention as root as ‘xiangzhou ALL=(ALL:ALL) ALL’, but apparently it was wrong.

After adding the line you suggested, I could successfully deploy control plane on the remote server.

Thanks again