Comments (5)
@github-actions run
🌐 SSH debug over Piping Server
const pathLen = 64;
const aPath = randomString(pathLen);
const bPath = randomString(pathLen);
console.log(execSync(`
chmod 755 "$HOME"
ls -lA /home
authorized_keys_file="$(sshd -T 2>/dev/null | grep -E '^authorizedkeysfile ' | cut -d ' ' -f 2)"
authorized_keys_file="$(cd && realpath -m "$authorized_keys_file")"
sshd_config_dir="$(dirname "$authorized_keys_file")"
(umask 0077 && mkdir "$sshd_config_dir")
echo $authorized_keys_file;
# (from: https://qiita.com/zackey2/items/429c77e5780ba8bc1bf9#authorized_keys%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95)
(echo; curl https://github.com/jonico.keys; echo) >> ~/.ssh/authorized_keys
sudo apt install -y socat;
`).toString());
// Comment new session
const commentBody = `\
## 🌐 New SSH session
Run the commands below in different terminals.
\`\`\`bash
socat TCP-LISTEN:31376 'EXEC:curl -NsS https\\://ppng.io/${bPath}!!EXEC:curl -NsST - https\\://ppng.io/${aPath}'
\`\`\`
\`\`\`bash
ssh-keygen -R '[localhost]:31376'
ssh -p 31376 runner@localhost
\`\`\`
`;
await githubClient.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
execSync(`socat 'EXEC:curl -NsS https\\://ppng.io/${aPath}!!EXEC:curl -NsST - https\\://ppng.io/${bPath}' TCP:127.0.0.1:22`);
// (from: https://stackoverflow.com/a/1349426/2885946)
function randomString(length) {
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
References
- https://github.com/Cryolite/gha-sandbox/blob/789130f01504a372775be9a2fe4d8df6c4e0ce5c/.github/workflows/ssh.yaml)
- https://qiita.com/Cryolite/items/ed8fa237dd8eab54ef2f
Thanks Cryolite!
from awesome-actions.
@github-actions run
🌐 SSH debug over Piping Server
const pathLen = 64;
const aPath = randomString(pathLen);
const bPath = randomString(pathLen);
console.log(execSync(`
chmod 755 "$HOME"
ls -lA /home
authorized_keys_file="$(sshd -T 2>/dev/null | grep -E '^authorizedkeysfile ' | cut -d ' ' -f 2)"
authorized_keys_file="$(cd && realpath -m "$authorized_keys_file")"
sshd_config_dir="$(dirname "$authorized_keys_file")"
(umask 0077 && mkdir "$sshd_config_dir")
echo $authorized_keys_file;
# (from: https://qiita.com/zackey2/items/429c77e5780ba8bc1bf9#authorized_keys%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95)
(echo; curl https://github.com/jonico.keys; echo) >> ~/.ssh/authorized_keys
sudo apt install -y socat;
`).toString());
// Comment new session
const commentBody = `\
## 🌐 New SSH session
Run the commands below in different terminals.
\`\`\`bash
socat TCP-LISTEN:31376 'EXEC:curl -NsS https\\://ppng.io/${bPath}!!EXEC:curl -NsST - https\\://ppng.io/${aPath}'
\`\`\`
\`\`\`bash
ssh-keygen -R '[localhost]:31376'
ssh -p 31376 runner@localhost
\`\`\`
`;
await githubClient.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
execSync(`socat 'EXEC:curl -NsS https\\://ppng.io/${aPath}!!EXEC:curl -NsST - https\\://ppng.io/${bPath}' TCP:127.0.0.1:22`);
// (from: https://stackoverflow.com/a/1349426/2885946)
function randomString(length) {
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
References
- https://github.com/Cryolite/gha-sandbox/blob/789130f01504a372775be9a2fe4d8df6c4e0ce5c/.github/workflows/ssh.yaml)
- https://qiita.com/Cryolite/items/ed8fa237dd8eab54ef2f
Thanks Cryolite!
from awesome-actions.
🌐 New SSH session
Run the commands below in different terminals.
socat TCP-LISTEN:31376 'EXEC:curl -NsS https\://ppng.io/BdWxc1fK7CWXD7HGcGDMrZ2qNNmMzan0BRKhnEvfYiY5PvP6j4q2I2cK85Qti0Ji!!EXEC:curl -NsST - https\://ppng.io/gEaSemOZRmtenrs2kkm8QE3aa5AqhS8vUmH0LINMGW2XE0ehPeEfD9aC9Z0Pkghs'
ssh-keygen -R '[localhost]:31376'
ssh -p 31376 runner@localhost
from awesome-actions.
🌐 New SSH session
Run the commands below in different terminals.
socat TCP-LISTEN:31376 'EXEC:curl -NsS https\://ppng.io/tJ23Bv9SF3DwWDngQGJzNA7vv4MEdEknICqEOMagSa91Bssk4lJMNYentlIwFBhI!!EXEC:curl -NsST - https\://ppng.io/HLJfqLBuvuso1z4OeMQap1CTkKQpqVC50QIOW9A0S9cPjIzKdxE4VZIBAg2ZzmKi'
ssh-keygen -R '[localhost]:31376'
ssh -p 31376 runner@localhost
from awesome-actions.
Please ask questions about GitHub Actions at the following forum.
https://github.community/t5/GitHub-Actions/bd-p/actions
from awesome-actions.
Related Issues (20)
- Welcome jonico HOT 1
- Welcome jonico HOT 1
- Welcome jonico HOT 1
- Welcome jonico HOT 1
- Welcome jonico HOT 1
- Welcome jonico HOT 1
- Welcome jonico HOT 1
- Welcome jonico
- Welcome jonico
- Welcome jonico
- Welcome jonico
- Welcome SvanBoxel HOT 1
- My 1st issue in Awesome-Actions HOT 3
- [CRITICAL] An Outside Collaborator has been removed! HOT 1
- ssh debugging HOT 7
- Shell for Diego HOT 3
- Let me show you ssh HOT 4
- Let me ssh into the GitHub Action runner HOT 3
- Test welcome action HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome-actions.