From: "Paul Kraus" <pkraus@pelsupply.com>
To: 'Paul Furness' <paul.furness@vil.ite.mee.com>,
linux-newbie@vger.kernel.org
Subject: RE: File in use Samba ( was Script as root)
Date: Tue, 1 Oct 2002 10:57:35 -0400 [thread overview]
Message-ID: <000001c2695a$e1001f90$64fea8c0@pkrausxp> (raw)
In-Reply-To: <1033482227.10135.152.camel@Zebra>
I have written the script to tar up folders on my xp box. The script
works. I mount -t smbfs .... The folder I want. I then tar mnt/folder
The problem is that I get errors saying that the file changed as we read
it. Or text file busy.
None of the files are in use. Nor are they system files of any kind. I
know for a fact that the xp system is not using them. Any ideas as to
what may be causing this?
I am smbmounting the drive rather then using smbtar due to the
limitations of smbtar.
My script tars up a folder and the dumps the output to a text file. The
script does this for about 4 different folders. It then tars the
tarballs together into one file with the "index" text files also tarred
up. It is then compresses using bzip2. The work files are deleted.
Paul
-----Original Message-----
From: Paul Furness [mailto:paul.furness@vil.ite.mee.com]
Sent: Tuesday, October 01, 2002 10:24 AM
To: Paul Kraus
Cc: linux-newbie@vger.kernel.org
Subject: Re: Script as root
There are a couple of ways, depending on how you are mounting the drive.
Dirty way:
If you are using NFS and are _not_ using an auto mounter of some kind
(amd, autofs), change the ownership of the script file to root, then
setUID on it. like this:
chown root SCRIPT
chmod +s SCRIPT
Note: Using SUID is not particularly secure. It's usually ok in a
trusted environment, but if a hacker could get anywhere near your linux
machine DON'T DO IT THIS WAY. In that case, look at using amd or autofs.
Cleaner way:
Presumably you are using SAMBA to mount the drive from your XP box. In
which case, you don't need to be root, provided that the mount point is
owned by the user. For example, as user paulk, you could create a
directory to use for the mount (mkdir ~/windows) and then you should be
able to mount the samba share as the user with:
smbmnt //machine/sharename ~/windows -o username=XPUSER,password=XPPASS
and later on unmount it with:
smbumount ~/windows
However, for this to work, smbmnt and smbumount must be suid. Assuming
you have a standard setup, you can do that like this (as root):
chmod +s /usr/bin/smbmnt /usr/bin/smbumount
Note: This is fairly safe to do; smbmnt and smbumount are designed to be
run this way.
Paul.
On Tue, 2002-10-01 at 14:55, Paul Kraus wrote:
> I have a backup script that mounts a drive on my xp workstations. Is
> there a way I can set this script to run as root so that I do not have
> to su every time I want to run it?
>
> Paul Kraus
> Network Administrator
> PEL Supply Company
> 216.267.5775 Voice
> 216-267-6176 Fax
> www.pelsupply.com
--
Paul Furness
Systems Manager
2+2=5 for extremely large values of 2.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
next prev parent reply other threads:[~2002-10-01 14:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-01 13:55 Script as root Paul Kraus
2002-10-01 14:23 ` Paul Furness
2002-10-01 14:57 ` Paul Kraus [this message]
2002-10-01 16:12 ` File in use Samba ( was Script as root) Ray Olszewski
2002-10-01 14:24 ` Script as root szonyi calin
2002-10-01 14:38 ` pa3gcu
2002-10-01 15:52 ` Ray Olszewski
2002-10-01 16:11 ` Jim Reimer
2002-10-01 21:10 ` pa3gcu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000001c2695a$e1001f90$64fea8c0@pkrausxp' \
--to=pkraus@pelsupply.com \
--cc=linux-newbie@vger.kernel.org \
--cc=paul.furness@vil.ite.mee.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.