Hi Mates,
We have request to configure ssh_key on some of the server with NOPASSWD. And a device will interact to destination server with user ID and run few commands to fetch the required data.
Command is : /usr/bin/su or /usr/bin/su -c env or /usr/bin/su - -c env
Soon, we run this command from device user ID, it will ask for root password. Though I have updated the sudo file, for not asking for root password. Could anyone help me an urgent please.
Sudo File :
cat Device42_ssh
# Run as sudo
Cmnd_Alias DEVICE42_CRONTAB = /usr/bin/crontab -u * -l, /bin/ls /var/spool/cron/crontabs, /bin/ls /var/spool/cron
# sudo, next non-sudo
Cmnd_Alias DEVICE42_PORTS = /bin/netstat -a
# OS specific services and packages.
Cmnd_Alias DEVICE42_OSCMD = /usr/sbin/lsof, /usr/sbin/format, /usr/bin/lslpp -l, /usr/bin/adb, /usr/sbin/exportfs, /usr/bin/echo, /usr/bin/grep, /usr/bin/showmount, /usr/bin/su - -c env
# non sudo, then sudo
Cmnd_Alias DEVICE42_SERVICES = /usr/bin/find /etc/init.d -perm *, /usr/bin/find /etc/rc.d/rc -perm *
# Always sudo
msadmtst ALL=(ALL) NOPASSWD: DEVICE42_DMIDECODE, DEVICE42_CRONTAB, DEVICE42_PORTS, DEVICE42_OSCMD, DEVICE42_SERVICES, /usr/bin/su
------------------------------
Sreenath Kambly
------------------------------
#AIXOpenSource