# Help with error when executing a remote command via ssh

**URL:** <https://www.ruby-forum.com/t/help-with-error-when-executing-a-remote-command-via-ssh/115704>\
**Category:** Ruby\
**Created:** [September 27, 2007, 8:11pm UTC](https://www.ruby-forum.com/t/help-with-error-when-executing-a-remote-command-via-ssh/115704 "2007-09-27T20:11:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ribes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f4b2a3/32.png) [@ribes](https://www.ruby-forum.com/u/ribes)\
**Post date:** [September 27, 2007, 8:11pm UTC](https://www.ruby-forum.com/t/help-with-error-when-executing-a-remote-command-via-ssh/115704/1 "2007-09-27T20:11:16Z")

</div>

Team,

I am running the following piece of code, which simply executes a remote  
command and output its outcome!  
However, I am getting a warning when executing the remote command.

1 - #!/usr/local/bin/ruby  
2 -  
3 - fh = File.open “/etc/servers” # Open list of servers for reading  
4 - svrs = fh.readlines # This is a small file, read it  
into  
memory  
5 - fh.close # We don’t need the file  
anymore  
6 -  
7 - svrs.each do |server| # Iterate over servers list  
8 - v = `ssh -q #{server.chomp} date` # Execute cmd on  
remote  
server  
9 - puts server.chomp.to\_s \<\< ": " \<\< v.to\_s  
10 - end

OUTPUT:

dshproc:8: warning: Insecure world writable dir /usr/local in PATH, mode  
0240777  
srv-app1was: Thu Sep 27 14:05:22 EDT 2007  
dshproc:8: warning: Insecure world writable dir /usr/local in PATH, mode  
0240777  
srv-db2db: Thu Sep 27 14:05:25 EDT 2007  
dshproc:8: warning: Insecure world writable dir /usr/local in PATH, mode  
0240777  
srv-app2cmrm: Thu Sep 27 14:05:25 EDT 2007  
dshproc:8: warning: Insecure world writable dir /usr/local in PATH, mode  
0240777  
srv-web3: Thu Sep 27 14:05:26 EDT 2007  
dshproc:8: warning: Insecure world writable dir /usr/local in PATH, mode  
0240777  
srv-db2passapp: Thu Sep 27 14:05:27 EDT 2007  
dshproc:8: warning: Insecure world writable dir /usr/local in PATH, mode  
0240777  
srv-svrsas: Thu Sep 27 14:05:27 EDT 2007

Any help will be appreciated!

Thanks

Victor

---

<div class="post-metadata">

**Author:** ![ribes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f4b2a3/32.png) [@ribes](https://www.ruby-forum.com/u/ribes)\
**Post date:** [September 27, 2007, 8:28pm UTC](https://www.ruby-forum.com/t/help-with-error-when-executing-a-remote-command-via-ssh/115704/2 "2007-09-27T20:28:14Z")

</div>

On 9/27/07, Victor R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> memory  
> dshproc:8: warning: Insecure world writable dir /usr/local in PATH, mode  
> srv-web3: Thu Sep 27 14:05:26 EDT 2007
> 
> Victor

This is an old topic… although I haven’t encountered it myself, you  
may try:  
[http://www.google.com/search?q=insecure+world+writable+ruby](http://www.google.com/search?q=insecure+world+writable+ruby)

Jano

---

<div class="post-metadata">

**Author:** ![ribes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f4b2a3/32.png) [@ribes](https://www.ruby-forum.com/u/ribes)\
**Post date:** [September 27, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/help-with-error-when-executing-a-remote-command-via-ssh/115704/3 "2007-09-27T21:15:28Z")

</div>

Thank you!
