Announcement

Collapse
No announcement yet.

Scripting with 90% normal user lines and 10% root level lines

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scripting with 90% normal user lines and 10% root level lines

    I'm trying to create a script so that it will do some rsync functions (works fine) and copying of some files that are root:root. Problem is, running the script as my user makes these files untouchable.

    I've seen some scripts that tell you to use 'echo password | sudo foo', but I have a HUGE problem with putting my password in a plain text.

    Anyone have experience editing /etc/sudoers?

    #2
    Re: Scripting with 90% normal user lines and 10% root level lines

    Originally posted by TheBigAmbulance
    Anyone have experience editing /etc/sudoers?
    man visudo should tell you what you need to know.'

    Code:
    VISUDO(8)                    MAINTENANCE COMMANDS                    VISUDO(8)
    
    NAME
        visudo - edit the sudoers file
    
    SYNOPSIS
        visudo [-c] [-q] [-s] [-V] [-f sudoers]
    
    DESCRIPTION
        visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against
        multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file
        is currently being edited you will receive a message to try again later.
    . . .
    I don't know how this will help with your script though. If I understand correctly you are trying to copy files which you don't have read access to. That is a permissions problem, but why do you need to copy such files? Which files are we talking about?
    Welcome newbies!
    Verify the ISO
    Kubuntu's documentation

    Comment


      #3
      Re: Scripting with 90% normal user lines and 10% root level lines

      Other than copying my Thunderbird and Firefox directories along with the Documents folder from my home, I want to make a list of currently installed packages. So I'm going to run

      Code:
      dpkg --get-selections | grep -v deinstall > kubuntu-files
      I then have a list of packages to reinstall in case of disaster. That and some ISCSI files (iscsi.conf and initiatorname)

      Comment

      Working...
      X