Re: Working as User other than Root in %post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> In the %post section, I add a user called 'jason' then I copy over some
> *.tgz files from the NFS server.  The owner and group for those files is
> root.  If I change the owner/group to 'jason' and untar the files into
> /home/jason, all the files are owned by jason but the directories created
> are owned by root.  I suppose this is because I untar them as root.  I need
> those directories to belong to jason.  I could do a chmod on the
> directories but I was hoping there was a different answer.  My question
> is......is there a way to 'login' as jason and untar the files in the %post
> section?

Why not do all command you want to do as jason in it's name like using:
su - -c "the command that you want to do with params..." jason

This is important, especially for tar which acts differently when
you are root or not.

					Anne





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux