Host-based backup of VMware vSphere VMs.
Post Reply
steelnwool
Enthusiast
Posts: 30
Liked: 1 time
Joined: Sep 03, 2010 4:44 pm
Full Name: Jeff MacDonald
Contact:

Which user do Linux scripts run as

Post by steelnwool »

Topic says it all, do linux scripts run as the root user, or as the user that ssh'd in ?
Dima P.
Product Manager
Posts: 14413
Liked: 1575 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Which user do Linux scripts run as

Post by Dima P. »

Jeff,
root should work.
alanbolte
Veteran
Posts: 635
Liked: 174 times
Joined: Jun 18, 2012 8:58 pm
Full Name: Alan Bolte
Contact:

Re: Which user do Linux scripts run as

Post by alanbolte »

Are you asking how to set the account for prefreeze/post-thaw scripts? The job will either use the account specified in the main guest processing page of the job settings, or the credentials you set for specific VMs after clicking the "Credentials..." button.
Vitaliy S.
VP, Product Management
Posts: 27107
Liked: 2717 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Which user do Linux scripts run as

Post by Vitaliy S. »

You can enable native VMware Tools quiescence to execute these pre-freeze/post-thaw scripts as well. Here is a bit more more information about this.
steelnwool
Enthusiast
Posts: 30
Liked: 1 time
Joined: Sep 03, 2010 4:44 pm
Full Name: Jeff MacDonald
Contact:

Re: Which user do Linux scripts run as

Post by steelnwool »

Well, I have it as a non root account that gets elevated via sudo. Which means it logs in as a user name veeam, and then sudos to root.

The part I'm not sure of is if it for pre/post scripts if it gets sudo'd or if it tries to run as vim. I'll just write a script to spit out the effective UID/GID to see what is up.

@Vitaliy S. - Thanks!.
steelnwool
Enthusiast
Posts: 30
Liked: 1 time
Joined: Sep 03, 2010 4:44 pm
Full Name: Jeff MacDonald
Contact:

Re: Which user do Linux scripts run as

Post by steelnwool »

The answer is root

Code: Select all

#!/bin/bash

echo uid is $UID >> /tmp/uid
echo euid is $EUID >> /tmp/uid

exit 0

ssh over to the VM and....

ls -l /tmp/uid
-rw-r--r-- 1 root root 19 Jul 16 09:44 /tmp/uid

cat /tmp/uid
uid is 0
euid is 0
Mind you, the job is still failing with "timed out waiting for script to finish execution" but I'll start another thread on that :)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 39 guests