-1

I am logged in as root in a freebsd (10) box and I am trying to execute a script (or any command) as another user, but I get: "su: Sorry"

root@vm ~ # whoami
root
root@vm ~ # cat /etc/passwd
#...
myuser:*:1001:1001:my name:/home/myuser:/usr/local/bin/bash
#...
root@vm ~ # su -m myuser -c '/bin/ls /tmp'
su: Sorry
root@vm ~ # su -m myuser
su: Sorry
Evan Carslake
  • 2,267
  • 15
  • 38
  • 56
Razvan Tudorica
  • 475
  • 5
  • 13

2 Answers2

2

su - is used to elevate access level. for example myuser executes as root. You are trying it reverse way. myuser is not member of "wheel" group.

Also it looks like root is not am member of "wheel" too. post what do you have in passwd for root?

Run as different user under FreeBSD

Community
  • 1
  • 1
skalinkin
  • 1,024
  • 9
  • 19
  • 1
    By default it is used to do that, but it is by no means the only way to use su. In the question that you link to there is acualy an answer that describes what what this user wants to do with su. – Lexib0y Apr 05 '16 at 09:55
0

I figured out how to do it: I installed the port security/sudo, and then I used sudo -u myuser.

legoscia
  • 39,593
  • 22
  • 116
  • 167
Razvan Tudorica
  • 475
  • 5
  • 13