Skip to content

ClassCastException com.jcraft.jsch.Session cannot be cast to java.lang.String clj-ssh.ssh/session-impl #53

Open
@af-fess

Description

@af-fess

I try to run command on remote machine, I success to connect through my MAC over ssh without password (use known_host)

so I run through REPL:

(let [agent (clj-ssh.ssh/ssh-agent {})]
  (clj-ssh.ssh/add-identity agent {
                                   :known-hosts-path "/Users/maxim/.ssh/known_hosts"
                                   :private-key-path "/Users/maxim/.ssh/id_rsa" 
                                   :public-key-path "/Users/maxim/.ssh/id_rsa.pub"
                                   })
  (let [session (clj-ssh.ssh/session agent "ops-ev19.comp.com" {:username "maxim" :strict-host-key-checking :no})]
    (clj-ssh.ssh/with-connection session

                                 (let [result (ssh session {:cmd "ls"})]
                                   (println (:out result))))))

and get error:

ClassCastException com.jcraft.jsch.Session cannot be cast to java.lang.String clj-ssh.ssh/session-impl (ssh.clj:318)


I use [clj-ssh "0.5.14"]

Any ideas?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions