I don't think there is something inherent to either language that makes it more or less suited to sys admin tasks. Python just happens to be used more often for this. Many Linux sys admin tools (GUI and non-GUI) are written in Python (PyQt/PyGTK). yum, HP printer tools, firewalld, the setup tools of many distributions, dtrace, iotop, anaconda, mercurial.

Python is stricter and more explicit. Ruby has many convenience functions that I consider messy and some even dangerous. E.g. Ruby supports the same ` `-Syntax as the Unix shell, with all it's implications.

So in Ruby you could do:

output = `/some/app #{arg}`

And in Python you would do this:

import subprocess
output = subprocess.Popen(["/some/app",arg],stdout=subprocess.PIPE).stdout.read()

Yes, it's more to write but it's more powerful and you don't have code injection problems. It feels to me that Python encourages you to do the proper clean thing while Ruby tries to be very concise and quick.

Also compare regular expressions.

Ruby:

if "foo" =~ /f(oo)/
puts $1
end

Oh my god, it assigns a global(?)/magic variable as a side effect. Yes, there are other ways to do it and when I write Ruby code I am using these other ways, but when I see other peoples Ruby code its done like that. I do this:

match = /f(oo)/.match("foo")
if match
puts match[1]
end

Python:

import re
match = re.match("f(oo)","foo")
if match:
print(match.group(1))

If you evaluate the regular expression more than once you should compile it:

import re
regex = re.compile("f(oo)")
match = regex.match("foo")
if match:
print(match.group(1))

Again in Python you tend to write it the clean way. Of course it's possible to write non-clean Python code and clean Ruby code, but the culture behind the languages encourage different things. You will find a lot of Ruby libraries/frameworks that extend (monkey patch) standard types. While this is also possible in Python (for non-builtin/-binding types) it is usually not done. Look at JavaScript: Prototype monkey patched a lot of standard types and messed up a lot. jQuery learned from that and tries not to monkey patch anything.

Another issue is string encodings. Note that what I write here applies to Python 3. It's a bit more complicated/less clean in Python 2.

The idea in Python is that files/network streams etc. are binary data and thus somehow encoded. But you as a programmer don't care about encodings, you want to manipulate text (or sequences of unicode code points). So you read bytes and decode them into str(ing)s. After you are done processing the text you encode with a certain encoding again and write the bytes into the file/network stream. So there is the bytes (and bytearray) class that has a decode method and there is the str class that has an encode method. str objects are always valid unicode codepoint sequences. Encoding errors can only happen on decode/encode.

In Ruby there are only Strings. These strings have an encoding attached. Binary data has the "encoding" ASCII-8BIT. You can force a wrong encoding onto a string which will cause an InvalidByteSequenceError at some later point. If you try to concatenate two String objects that have a different encoding you will get a CompatibilityError. You can only hope that all your DB drivers return proper UTF-8 strings in all cases. I was told even Perl does this better (like Python).

Furthermore in Ruby strings are mutable, in Python they are immutable. This means if you get a string passed in Ruby and want to store it in a classes attribute and want to be sure it does not change under your but you have to make a copy.

So you can clearly see what language I think is cleaner.
I write Ruby code for work but when I write some shell script to automate some task/write some small GUI tool I use Python (and PyQt).