Operating System - HP-UX
1833011 Members
2646 Online
110048 Solutions
New Discussion

Best way to set up backup user

 
SOLVED
Go to solution
Chrisl_2
Frequent Advisor

Best way to set up backup user

Hi all,

I am using rsync and ssh from a linux box to backup an HP.

something like...

rsync -ave ssh backupuser@targethost.com:/ /bu/

What is the best way to setup the user account (backupuser) on the HP so that it has permissions to backup the entire server (I don't want to use root).

TIA
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Best way to set up backup user

Only root will have sufficient priviliges to access everything. So you either run it as root or setup sudo to allow a regular user to execute the command as root. Don't even think about creating another UID 0 account.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Best way to set up backup user

Shalom Chris,

I think your approach is going to mangle file permissions and ownership. This will make restoring the data have an extra problematic step, restoring ownership.

It may be impossible to restore ownership and get your system working.

Here is why.

scp -p means preserve permissions. Universally, it does not preserve permissions very well, and does not preserve ownership, even if the file owners exist on both systems.

If you had the same users on both systems, your scheme might work, except for certain files that only root has access to.

I reluctantly conclude that you should use root.

I use root user and a script very similar to yours to maintain data sync in a Red Hat Cluster in my home office. There is absolutely no security problem doing this.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Chrisl_2
Frequent Advisor

Re: Best way to set up backup user

OK, sudo it is. It's a cronned script, doesn't sudo require another password? If so, I need a way to automate that.

Thanks!
A. Clay Stephenson
Acclaimed Contributor

Re: Best way to set up backup user

If it's cronned then it might as well be root's crontab. Only root will have access to that file so you don't need sudo. You might also use sudo to allow a regular user to manually initiate an rsync.
If it ain't broke, I can fix that.