Skip to content
Snippets Groups Projects
Verified Commit ae4e220b authored by David Beniamine's avatar David Beniamine
Browse files

Send rsa key

parent 7749f894
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ if [ ! -d $conf_dir ] ...@@ -30,6 +30,7 @@ if [ ! -d $conf_dir ]
then then
# Init # Init
mkdir $conf_dir mkdir $conf_dir
ssh-keygen -P "" -f /root/.ssh/id_rsa
else else
# Clean # Clean
while read line while read line
...@@ -49,6 +50,8 @@ do ...@@ -49,6 +50,8 @@ do
then then
date=$(date +%Y%m%d) date=$(date +%Y%m%d)
res=$(grep "$line" $conf_file) res=$(grep "$line" $conf_file)
rIP=$(echo $line | cut -d ' ' -f 3)
line=$(echo $line | cut -d ' ' -f 1-2)
if [ ! -z "$res" ] if [ ! -z "$res" ]
then then
# Update # Update
...@@ -57,6 +60,7 @@ do ...@@ -57,6 +60,7 @@ do
# Add # Add
echo "$date $line" >> $conf_file echo "$date $line" >> $conf_file
fi fi
cat /root/.ssh/id_rsa.pub | netcat $rIP $port
fi fi
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment