As part of a script I have
gnome-terminal -e "process involving another user"
Once executed this line, I have to write in the terminal 3 times the password of this user. I wonder how can I automate it, that is, without typing the password. Something as
echo "password" (3 times) | gnome-terminal -e "process involving another user"
Thank @rao_555, but I'm afraid things are not so easy. I use the command
gnome-terminal --working-directory="/var/singlecellserver/single-cell-server" \
-e "sage -python trusted_db.py -w 50 --untrusted-account untrusted@localhost" &
So, I don't want pass arguments to sage -python ...
. Once sage -python ...
is launched I need to give 3 times untrusted's password. I tried
gnome-terminal --working-directory="/var/singlecellserver/single-cell-server" \
-x sage -python trusted_db.py -w 50 --untrusted-account untrusted@localhost $1 $1 $1 &
but no success.
SOLVED
The problem was related to sudo
and ssh
. Since it is necessary to launch the process as su
, the access via ssh
to the untrusted account needs the ssh
keys also in the root folder.