GithubHelp home page GithubHelp logo

Comments (5)

rminnich avatar rminnich commented on September 27, 2024

that's weird, this should work, can you try again. I could have sworn the new ssh client package I'm using does this.

from cpu.

truatpasteurdotfr avatar truatpasteurdotfr commented on September 27, 2024
[tru@elitebook840g3 cpu]$ go version
go version go1.17 linux/amd64
[tru@elitebook840g3 cpu]$ git pull
Already up-to-date.
[tru@elitebook840g3 cpu]$ git status
# On branch main
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   go.mod
#
no changes added to commit (use "git add" and/or "git commit -a")
[tru@elitebook840g3 cpu]$ git diff
diff --git a/go.mod b/go.mod
index acb4545..8fb3b74 100644
--- a/go.mod
+++ b/go.mod
@@ -23,3 +23,5 @@ require (
        github.com/vishvananda/netlink v1.1.1-0.20211118161826-650dca95af54 // indirect
        github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
 )
+
+require github.com/hashicorp/errwrap v1.0.0 // indirect
[tru@elitebook840g3 cpu]$ ~/go/bin/gox -os="linux" -arch="amd64"  ./...
Number of parallel builds: 3

-->     linux/amd64: github.com/u-root/cpu/cmds/cpud
-->     linux/amd64: github.com/u-root/cpu/cmds/cpu

trying ssh and cpu:

[tru@elitebook840g3 cpu]$ ssh here cat /tmp/toto
titi
[tru@elitebook840g3 cpu]$ ./cpu_linux_amd64 -d -bin /home/tru/git/github.com/u-root/cpu/cpud_linux_amd64 here  cat -r /tmp/toto
2022/03/07 22:23:04 
Running as client, to host "here", args "cat -r /tmp/toto"
2022/03/07 22:23:04 getKeyFile for ""
2022/03/07 22:23:04 key file from config is "~/.ssh/keys/5CG6481CF1/id_ed25519"
2022/03/07 22:23:04 getKeyFile returns "/home/tru/.ssh/keys/5CG6481CF1/id_ed25519"
2022/03/07 22:23:04 getPort("here", "")
2022/03/07 22:23:04 config.Get("here",""): "22"
2022/03/07 22:23:04 getPort: return default "23"
2022/03/07 22:23:04 returns "23"
2022/03/07 22:23:04 SSH error ParsePrivateKey /home/tru/.ssh/keys/5CG6481CF1/id_ed25519: ssh: this private key is passphrase protected

from cpu.

orangecms avatar orangecms commented on September 27, 2024

Ah, that thing. This is because of an opinionated decision. Look closely at the port decision: cpu forces using port 23 when 22 is provided.

https://github.com/u-root/cpu/blob/59e1ebe6207a2294ce032c73b0476bbae956ceb6/cmds/cpu/cpu.go#L401-403

from cpu.

orangecms avatar orangecms commented on September 27, 2024

IIRC, the idea was to distinguish between regular SSH and this implementation of cpu building on top of it.

Should we add a flag in order to allow for using cpu as a regular SSH client?
Like, cpu -ssh remote-machine ls? It could imply the port 22 even.

from cpu.

truatpasteurdotfr avatar truatpasteurdotfr commented on September 27, 2024

I have added port 23 in my .ssh/config file:

Host localhost here
        hostname localhost
        IdentitiesOnly=yes
        IdentityFile ~/.ssh/keys/5CG6481CF1/id_ed25519
        ForwardX11 yes
        Port 23 

I need to force the -p 22 to have ssh working:

[tru@elitebook840g3 cpu]$ ssh -p 22 here cat /tmp/toto
X11 forwarding request failed on channel 1
tototot
[tru@elitebook840g3 cpu]$ ./cpu_linux_amd64 -d -bin /home/tru/git/github.com/u-root/cpu/cpud_linux_amd64 here  cat -r /tmp/toto
2022/03/31 14:50:17 
Running as client, to host "here", args "cat -r /tmp/toto"
2022/03/31 14:50:17 getKeyFile for ""
2022/03/31 14:50:18 key file from config is "~/.ssh/keys/5CG6481CF1/id_ed25519"
2022/03/31 14:50:18 getKeyFile returns "/home/tru/.ssh/keys/5CG6481CF1/id_ed25519"
2022/03/31 14:50:18 getPort("here", "")
2022/03/31 14:50:18 config.Get("here",""): "23"
2022/03/31 14:50:18 returns "23"
2022/03/31 14:50:18 SSH error ParsePrivateKey /home/tru/.ssh/keys/5CG6481CF1/id_ed25519: ssh: this private key is passphrase protected

from cpu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.