-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSsh.java
More file actions
44 lines (42 loc) · 2 KB
/
Copy pathSsh.java
File metadata and controls
44 lines (42 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.io.*;
// Steps for pubkey generation:
// 1. Run "ssh-keygen" - Don't give passphrase
// 2. ssh-copy-id -i "your key" user@host // to one machine is enough
public class Ssh {
public static void main(String[] args) {
String username = "dreddy"; //Login UserID
String projPath = "/cise/homes/dreddy/CN/project"; // path of the project where PeerProcess binary
// is
String pubKey = "rsakey"; // location of the generated key
try {
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-00.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1001 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-01.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1002 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-02.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1003 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-03.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1004 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-04.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1005 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-05.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1006 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-06.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1007 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-08.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1008 ");
Runtime.getRuntime().exec("ssh -i " + pubKey + " " + username +
"@lin114-07.cise.ufl.edu cd " + projPath
+ " ; java PeerProcess 1009 ");
} catch (Exception e) {
}
}
}