Re: Writing scripts in Linux



Rich Leitner <Rich@xxxxxxxxxxxxx> writes:

On Mon, 15 Oct 2007 09:32:33 -0400, Dan Espen wrote:

Cisco_King <dineshaggarwal@xxxxxxxxx> writes:
....blatant attempt to increase hits to his own website deleted ...

Really?

Learn to write scripts as root,
what a concept.

Lots of errors there too.

Okay, I'm a bit new to shell scripting but learning. What's wrong with
writing a shell script as root so long as the script does not have root
privileges itself?

Unless you are perfect, your scripts will have errors.
If you write and test them as root, the simplest coding error
could wipe your whole system.

Write scripts as a regular user and never test scripts with live
data. Only after you are sure it is working do you run it with
live data or as root.
.



Relevant Pages

  • SUMMARY and apology Re: Some bash/tty questions
    ... Some people tend to create complex login scripts ... If you don't allow direct login to root, but rather su to root, then so ... Hi, not to bash down on bash, but perhaps you should try zsh, it has the shared history thing built in. ...
    (SunManagers)
  • RE: suEXEC
    ... Change your web scripts to create a file of usernames to create, for example, /var/tmp/users. ... The file should be owned by root, group apache, with permissions 660. ... first virtual hosting is showing username cgiuser but second virtual ...
    (RedHat)
  • Re: Run script as root from WebServer
    ... through a web interface. ... The problem is that some of these scripts deal with configuration files and ... some other tasks that require root privileges. ... This allows the www user to run the wireless connection setup/teardown ...
    (freebsd-questions)
  • Re: user permission problems
    ... Subject: user permission problems ... Note you should put any commands in a shell script so asroot can execute it with root perms, and you can add sanity tests to prevent things like ... add root and the special scripts like "kill_it' to the users that will use the scripts. ... I would assume the symlink is done from another restricted dir, such as a support dir owned by the support login, and only RW perms for the owner. ...
    (comp.unix.sco.misc)
  • Re: awstats munged httpd rights in SElinux, how to fix?
    ... terminal as root for configuration issues. ... your computer up to the world as a webserver. ... I don't have the scripts ... (i.e. encrypted access only). ...
    (Fedora)