Hello!
I have created a new user with vSphere Client and have grant Shell-Login.
But if I want to connect with ssh I get the message "Access Denied"!
What do I have to do?
thx
hansi
Hi,
a)
in the /etc/security/access.conf you need to set a line:
+:username:ALL
before the -:ALL:ALL line!
or
b)
add the user to the root-group (usermod -a -G root username)
I would prefer a
Regards
Have you tried the steps in following kb, if not please try that.
If you have tried and your getting error message, please be clear at what point you get that error and also put a screen shot here.
Award points for the helpful and correct answer by clicking the below tab
Hi,
a)
in the /etc/security/access.conf you need to set a line:
+:username:ALL
before the -:ALL:ALL line!
or
b)
add the user to the root-group (usermod -a -G root username)
I would prefer a
Regards
many thanks
only a) I needed
hansi
Hi You can do this in two ways, either using the vSphere Client to connect directly to the host as root – selecting the Local users and group tab and adding your user to the root group, or from the Service Console you can use the command usermod -a G 0 username
_____
Thanks
Hello!
The Login works fine. I didn't add the user "usvuser" to the root-group, because he didn't need root-rights.
Now this user should be able to list and shutdown vms.
vmware-vim-cmd vmsvc/getallvms
But I get following error:
Failed to login: vim.fault.NoPermission
in /etc/sudoers i put following line:
%usvuser ALL=NOPASSWD:/usr/bin/sudo, /bin/bash, /test/test_shutdown_vms.sh, /usr/bin/vim, /usr/bin/vimsh, /usr/bin/vmware-vimsh, /usr/bin/vmware-vim-cmd, /usr/bin/vmware-cmd, /bin/echo, /bin/date, /bin/sed,
/bin/awk
What I have forgotten?
thx.
hansi
Hi,
maybe you just forgot to write "sudo" in front of the command: "sudo vmware-vim-cmd vmsvc/getallvms"
Or your user "usvuser" is not in the group "usvuser", your entry in the /etc/sudoers gives the rights to the group usvuser and not the user itself. Remove the "%" to make it available to the user.
Regards
hello again!
My script is ready, but one problem I have:
[usvuser@ATESX1 USV]$ /sbin/shutdown -h now
shutdown: you must be root to do that!
In /etc/sudoers I have:
usvuser ALL=NOPASSWD:/USV/shutdown_vms.sh, /USV/TEST_shutdown_esx.sh, /USV/TEST_shutdown_vms.sh, /USV/USVonline.txt, /USV/LOGS, /usr/bin/sudo, /bin/bash, /usr/bin/vim, /usr/bin/vimsh$
usvuser localhost=/sbin/shutdown -h now
what do I have to do that the User "usvuser" is able to shutdown the ESX-Host.
thx
--> hansis100 is my new account
1 year later... :smileysilly:
well you have to execute it with sudo in front, so:
sudo /sbin/shutdown -h now
you forgot the sudo here:
[usvuser@ATESX1 USV]$ /sbin/shutdown -h now
shutdown: you must be root to do that!
Regards
Yes one year ago
thx.
another problem: I have startet the Script with sudo TEST_shutdown.sh
And now I have to put in a password?!?
[usvuser@ATESX1 USV]$ ./TEST_shutdown_esx.sh
Password:
Whats this?
thx
Try to call the complete path:
"sudo /USV/TEST_shutdown_esx.sh"
Yeah!
No my script is running
thx to all