0

I need to switch to another user with sudo su -user command but I have problems with that because it was asking me password so I type something like echo mypass | sudo -S su user and it doesn't work also.

How can I switch user without asking me password or can I send somehow password like su user -p password?

lara_croft
  • 11
  • 4
  • 1
    Possible duplicate of [how to run script as another user without password](http://stackoverflow.com/questions/6905697/how-to-run-script-as-another-user-without-password) – Oleksandr Kravchuk Apr 24 '17 at 09:51
  • 1
    First of all, this is not a programming question; second, it's been answered 700 times on this site already, so please, just use search box. – Oleksandr Kravchuk Apr 24 '17 at 09:52
  • I was searching answer in previous questions but I didn't find solution which was working for me, but I have found some kind of solution by myself. if I execute this `echo mypass | sudo -S su user` and after that `sudo su user` then it switch user without asking me password. – lara_croft Apr 27 '17 at 09:02

0 Answers0