[NTLUG:Discuss] Bash Scripting and permissions

Patrick Parks patrick at patrickparks.com
Sat Nov 23 02:42:29 CST 2002


I am working on a simple bash script, that will tar and zip my home dir 
onto a remote backup computer across nfs. On the backup computer in the
/etc/exports file the permissions for the share that is exported to nfs
is using the defaults, the root_squash. I would like to keep this as is
if possible, for security. Now back to my script. My script checks to
see if the directory is mounted before trying to tar then zip the file
to it.If it is not mounted, it then attempts to mount it. This is where
the problem comes in. In order to mount the nfs directory, I must be
root. If I run the script as root, when it gets to the part about
copying the files to the remote mounted nfs drive, it does not let me
copy, cause I am root, and the root_squash is on   in the exports
permissions. As I am writing this I am getting some ideas :) Can a user
have permissions to mount a remote nfs directory without having to sudo?
That may be my answer there, off to the search engines to see if this
will work, would appreciate any suggestions. Thanks
-- 
Patrick Parks <patrick at patrickparks.com>




More information about the Discuss mailing list