0

So I am changing all of the question so you can understand my purpose:

I have this script.sh:

$HADOOP_HOME/sbin/start-dfs.sh
$HADOOP_HOME/sbin/start-yarn.sh
cd /home/hadoop/apache-hive-3.1.1-bin/ 
hiveserver2 & 
sudo /opt/hue/build/env/bin/hue runserver &

I want it to be run automatically when ubuntu boots and I login to second user hadoop.

PROBLEM:

This script should be executed by user hadoop. This hadoop user has a password. Ubuntu boots on another user by default.

How should I do please? Newbie alert!

Haha
  • 105

1 Answers1

0

Read man sudoers and you can do sudo -u hadoop the script, and allow user hadoop to execute those specific commands NOPASSWWD.

waltinator
  • 36,399