Jennifer Kimball commited on
Commit
5d87633
·
unverified ·
1 Parent(s): 4efc2a2

Create key_setup.sh - part1 - testing how the key gets added

Browse files
Files changed (1) hide show
  1. key_setup.sh +25 -0
key_setup.sh ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! /bin/bash
2
+
3
+ PORT=22003
4
+ MACHINE=paffenroth-23.dyn.wpi.edu
5
+
6
+ # login using student-admin key
7
+ ssh -i student_admin -p {PORT} student-admin@{MACHINE}
8
+
9
+ # move directories
10
+ cd .ssh
11
+
12
+ # open the authorized_keys file
13
+ nano authorized_keys
14
+
15
+ # add our key to the authorized_keys file
16
+ cat my_key2.pub > authorized_keys
17
+
18
+ #change permissions on the keys
19
+ chmod 600 authorized_keys
20
+
21
+ echo "checking that the authorized_keys file is correct"
22
+ ls -l authorized_keys
23
+ cat authorized_keys
24
+
25
+ #WANT TO PUT A CHECK ON THE PERMISSIONS