0

am trying to execute these two unix commands using python

import os
os.system('sudo - john')
os.system('psconfig show')

Here the issue is first command is executed i.e. it is switching to user john but second command is not executed .when i give exit from the user john, second command is executed in local shell and it is showing error as "psconfg show" command not found . Basically first command is executed but the second command i want is execute is in user john's shell but it is getting executed on the local shell .Can anyone help in this issue please

ewokx
  • 2,204
  • 3
  • 14
  • 27

0 Answers0