March 7, 2021.
-tt instead of -it to the command
ssh -i .ssh/ubuntu_sinnud.pem sinnud@192.168.1.213 sudo docker exec -tt greenplum su - gpadmin /code/scripts/gpinit2.bash
sudo visudo在编辑器中加入一行
(Run sudo visudo to add the line below such that user sinnud can run sudo docker without password)
sinnud ALL=(ALL) NOPASSWD:/bin/docker
ssh -i .ssh/ubuntu_sinnud.pem sinnud@192.168.1.213 sudo docker exec -it greenplum su - gpadmin /code/scripts/gpinit2.bash
会出错:(will error out:)
the input device is not a TTY
需要改成:(Need to be changed from -it to -tty)
ssh -i .ssh/ubuntu_sinnud.pem sinnud@192.168.1.213 sudo docker exec -tty greenplum su - gpadmin /code/scripts/gpinit2.bash