Cannot switch user in exec pipeline

Tried to switch system user by following pipeline config

kind: pipeline
type: exec
name: deploy

  os: linux
  arch: amd64

- name: restart
  - su - ubuntu
  - whoami

but still getting a root user, anyway to swtich user?

1 Like

The commands section is essentially just a bash script. Are you sure you can use su in a bash script like this? According to Stackoverflow it is not possible:

Right the problem was fixed, anyway is it possible set a user to execute the commands in yml config file?