Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.
This repository was archived by the owner on May 25, 2025. It is now read-only.

Add in support for behavoir like: ssh -t sshUser@host "sudo -u OTHERUser somecommand"  #241

@fwelland

Description

@fwelland

Using: 'org.hidetake:groovy-ssh:2.9.0'

Actually writing groovy code, not gradle stuff.

I have a hunk of ssh like:

        ssh.run {
            session(host: targetHost, user: uzer, password: passwd) {                    
                executeSudo('gpg --list-keys', errorStream : System.out, pty : true) {  println it }
            }        
        }

But would like to be able to do something like this:

        ssh.run {
            session(host: targetHost, user: uzer, password: passwd) {                    
                executeSudo('gpg --list-keys', sudoUser:  differentUserNotSSHUser,  sudoUserPass : somePassword, errorStream : System.out, pty : true) {  println it }
            }        
        }

Does groovy-ssh support this? Or can this be considered for a new feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions