Results 1 to 3 of 3

Thread: [bash] sudo -S problem after install of 10.04

  1. #1
    Join Date
    Apr 2010
    Location
    Europe
    Beans
    3

    Cool [bash] sudo -S problem after install of 10.04

    Hi,

    I had some bash scripts on Ubuntu 09.10 (mint version) that fail to work on Ubuntu 10.04.

    The line that fails is the following:
    Code:
    # cat file_with_my-password.txt > sudo -S something
    cat: invalid option -- 'S'
    Try `cat --help' for more information.
    In my case "something" mounts some filesystems (that fail to load from fstab - bios "fake" raid 10), but I get the same error for any sudo command.

    It is the same script that used to work under 09.04 :-/

    Any help highly appreciated!

    Ph.

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: [bash] sudo -S problem after install of 10.04

    It's:
    Code:
    cat file_with_my-password.txt | sudo -S something
    You have to pipe the password to sudo instead of redirecting the output of cat to the sudo file.

    But storing your password in a plain text file is a huge security risk. I would suggest you to edit the sudoers file & allow your user to run the specific command without a password.

    HowTO: Sudoers Configuration

  3. #3
    Join Date
    Apr 2010
    Location
    Europe
    Beans
    3

    Re: [bash] sudo -S problem after install of 10.04

    Hi, thanks for the answer.

    that gives another error message
    Code:
    bash: line 1: *****: command not found
    (in the place of the the five stars is the password)

    I guess that your suggestion about sudoers is anyhow the way to go (although very strange that this stopped working, isn't it?)
    I will report later if it works, because I want the command to be executed always before the user (person) can do something. --> it goes in /etc/init.d

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •