0

I am trying to switch the user in pC. I don't want to type the password after prompt. Instead I want to pass it while doing a login.

For example-

$su loolu oohlala

How to pass the password in the su command.

Robin Green
  • 32,079
  • 16
  • 104
  • 187
dexterous
  • 6,422
  • 12
  • 51
  • 99
  • 1
    You cannot do it for security reasons. You can however configure your sudo users to perform some of the actions without providing any password. – Artem Shinkarov Nov 23 '13 at 05:12

1 Answers1

1

There are two approaches I would recommend: the easy way, and the hard way.

The hard way is a su wrapper, gsu or ksu. If you look at the source code of these applications, you can learn how to do this, but it is not easy.

The easy way is to use a tool that does not require a password in all configurations instead of su. I would recommend either sudo or super. I prefer super for scripts, but both work fine for this, and can be configured not to ask a password.

hildred
  • 453
  • 11
  • 29