How about this ?

```ruby
def check_authorized_key user, key
  "grep -w '#{key}' ~#{user}/.ssh/authorized_keys"
end
```