Commit 0c2e2fde authored by John H. Osorio Ríos's avatar John H. Osorio Ríos
Browse files

Cleaning create function

parent 0d569432
if type keychain >/dev/null 2>/dev/null; then
keychain --nogui -q .ssh/id_rsa
[ -f ~/.keychain/${HOSTNAME}-sh ] && . ~/.keychain/${HOSTNAME}-sh
......
......@@ -110,22 +110,14 @@ exports.createUserCluster = (uid, username, callback) => {
exports.sshKey = (user, callback) => {
const ssh = new SSH({
host: 'localhost',
port: 4000,
user: user.username,
pass: decrypt(user.linux)
});
const pathKey = `ssh-keygen -b 2048 -t rsa -f /homeshare/${user.username}/.ssh/id_rsa -q -N ""`,
autKeys = `cat /homeshare/${user.username}/.ssh/id_rsa.pub >> /homeshare/${user.username}/.ssh/authorized_keys`,
pathSSH = `echo "if type keychain >/dev/null 2>/dev/null; then
keychain --nogui -q .ssh/id_rsa
[ -f ~/.keychain/$"`,
pathSSH2 = `echo "{HOSTNAME}-sh ] && . ~/.keychain/$"`,
pathSSH3 = `echo "{HOSTNAME}-sh
[ -f ~/.keychain/$"`,
pathSSH4 = `echo "{HOSTNAME}-sh-gpg ] && . ~/.keychain/$"`,
pathSSH5 = `echo "{HOSTNAME}-sh-gpg
fi"`,
fileSSH = ' >> /homeshare/' + user.username + '/.bashrc';
autKeys = `cat /homeshare/${user.username}/.ssh/id_rsa.pub >> /homeshare/${user.username}/.ssh/authorized_keys`;
ssh
.exec(pathKey, {
err: stderr => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment