I want to do a sudo command to change permissions on our server
because our admin has some kind of build
that blows away the image directory and it ends up having the wrong
permissions after the build.
When the sudo command is run it will prompt for a password and I need
to write the password to it. If I just write to the stream before it
prompts, I'm not sure if it will work ? Also if someone could give me
the exact stuff that they think will work, that would be helpfull as I
am concerned if I play with it and have failed attempts it might lock
my account. I want to be able to email the group and say, 'hey here is
a script that runs every 10 minutes from my pc and fixes the build
problem", If possible, I don't want the admins to be upset with me for
getting my account locked because I was playing around. Our server
runs linux, thanks. Below is sort of what my script would do, but the
password part is missing. As I said, it may be an easy thing, I'm just
affraid of getting it wrong ...
Open3.popen3 "ssh hostname sudo ls" do |i,o,e|
i.puts "your password"
puts o.read
end
PS: I hope that isn't your password
···
On Aug 18, 2007, at 02:35, wbsurfver@yahoo.com wrote:
I want to do a sudo command to change permissions on our server
because our admin has some kind of build
that blows away the image directory and it ends up having the wrong
permissions after the build.
When the sudo command is run it will prompt for a password and I need
to write the password to it. If I just write to the stream before it
prompts, I'm not sure if it will work ? Also if someone could give me
the exact stuff that they think will work, that would be helpfull as I
am concerned if I play with it and have failed attempts it might lock
my account. I want to be able to email the group and say, 'hey here is
a script that runs every 10 minutes from my pc and fixes the build
problem", If possible, I don't want the admins to be upset with me for
getting my account locked because I was playing around. Our server
runs linux, thanks. Below is sort of what my script would do, but the
password part is missing. As I said, it may be an easy thing, I'm just
affraid of getting it wrong ...