Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lovelace
webLovelace
Commits
0c2e2fde
Commit
0c2e2fde
authored
Mar 01, 2017
by
John H. Osorio Ríos
Browse files
Cleaning create function
parent
0d569432
Changes
2
Hide whitespace changes
Inline
Side-by-side
helpers/key
View file @
0c2e2fde
if type keychain >/dev/null 2>/dev/null; then
keychain --nogui -q .ssh/id_rsa
[ -f ~/.keychain/${HOSTNAME}-sh ] && . ~/.keychain/${HOSTNAME}-sh
...
...
helpers/user.js
View file @
0c2e2fde
...
...
@@ -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
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment