Skip to content

Commit 0624a95

Browse files
Merge for Project Titan
Merge pull request #55 from SecureWindowsShell/unstable
2 parents 672f7fa + d28f761 commit 0624a95

8 files changed

Lines changed: 569 additions & 768 deletions

File tree

CONTRIBUTING.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ A report should contain the following:
3838

3939
**Description**:
4040

41-
* SWSH Version: beta 3.0
41+
* SWSH Release: Titan
4242
* Windows 10 1709
4343
* .NET framework 4.7
4444

@@ -65,31 +65,16 @@ Details should include:
6565
You can make a pull request, but it should follow guidelines described here and in our [code of conduct](#code-of-conduct).
6666

6767
### Somethings to remember when writing code:
68-
69-
* Global variable names starts with an underscore (_), except for local variables.
70-
71-
Example: `var _name = "Hi, I am a variable, I vary.";`
72-
73-
* Global functions/methods starts with two (2) underscores (__), except for local functions.
74-
75-
Example:
76-
```cs
77-
public static string __name() {
78-
...
79-
// your code here
80-
...
81-
}
82-
```
8368
* If a function is only required for one function, it should be a local function to the latter function.
8469
Example:
8570
```cs
8671
// Instead of this:
87-
public static string __name() {
72+
public static string Name() {
8873
...
89-
__otherFunction(str);
74+
OtherFunction(str);
9075
...
9176
}
92-
public static string __otherFunction(string s) {
77+
public static string OtherFunction(string s) {
9378
...
9479
// your code here
9580
...
@@ -98,11 +83,11 @@ public static string __otherFunction(string s) {
9883

9984

10085
// Do this:
101-
public static string __name() {
86+
public static string Name() {
10287
...
103-
otherFunction(str);
88+
OtherFunction(str);
10489
...
105-
string otherFunction(string s) {
90+
string OtherFunction(string s) {
10691
...
10792
// your code here
10893
...

DOCUMENTATION.md

Lines changed: 46 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
# Documentation for SWSH
22

3-
For Version beta-3.0
3+
For Titan
44

55
## Index
66

77
* [Getting Started](#getting-started)
8-
* [Nicknames](#nicknames)
98
* [Generating SSH keys](#generating-ssh-keys)
10-
* [Making a nickname with Private key](#making-a-nickname-with-key)
11-
* [Making a nickname with Password](#making-a-nickname-with-password)
9+
* [Importing SSH keys](#importing-ssh-keys)
10+
* [Connecting to a host](#connecting-to-a-host)
1211
* [Commands](#commands)
1312
* [version](#version)
14-
* [add [-password]](#add)
15-
* [show [nickname]](#show)
1613
* [connect [nickname]](#connect)
17-
* [delete [nickname]](#delete)
18-
* [edit [nickname] [arg]](#edit)
1914
* [keygen](#keygen)
2015
* [help [command]](#help)
2116
* [clear](#clear)
@@ -28,82 +23,61 @@ For Version beta-3.0
2823

2924
## Getting Started
3025

31-
### Nicknames
32-
33-
SSH connections are saved as **nicknames**, each nickname has to be unique.
34-
3526
### Generating SSH keys
3627

37-
SSH keys serve as a means of identifying yourself to an SSH server. To Generate your private and public key, SWSH uses an add-on, swsh-keygen. You can [build swsh-keygen](https://github.com/SecureWindowsShell/swsh-keygen) yourself if you want and place the executable (.exe) in SWSH's root directory.
28+
SSH keys serve as a means of identifying yourself to an SSH server. To Generate your private and public key, SWSH uses an add-on, swsh-keygen. You can [build swsh-keygen](https://github.com/SecureWindowsShell/swsh-keygen) yourself if you want and place the executable (.exe) in SWSH's root (installation) directory.
3829

39-
Use command ```keygen``` to tell SWSH that you want to generate a new RSA key pair for SSH connection after that just follow the prompts.
30+
Use command ```keygen``` to tell SWSH that you want to generate a new RSA key pair for SSH connection after that just follow the prompts.
4031
You'll be asked for locations to store your keys, leave it blank if you want it to be default.
4132
Output will be similar to this:
4233

4334
```swsh
4435
/users/muzzammil:swsh> keygen
36+
37+
Generating public/private rsa key pair.
4538
exit or -e to cancel.
46-
Enter path to save private key (swsh.private):
47-
Enter path to save public key (swsh.public):
39+
Enter absolute path to save private key (%appdata%/SWSH/swsh.private):
40+
Enter absolute path to save public key (%appdata%/SWSH/swsh.public):
4841
Your public key:
4942
50-
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDIAHPhxzRApbQgcgDCXysDqkBezHgHBHJTeBpfcGXfkHyGKUlbv7X1Ftz5Qyl6lEPwTg2vOR+FCMKbOOVbv5ISZXJJyGSiPPqis0Jfp58wmSjPuyS78N+ZgqynD6SXbcKbJhEYtriPBKueraj3lY3DYQjRQR42YoeAqjcAg2Riew==
43+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCt2MxdswuuUvmaY4JK6kP4lYIqGy0KeHCqcx1NEjB4EcqH7+MIeXGbdikACvP3wlOAEAt+7PMEhBHf7nL2S2SsOybpegJw0piiMeOIPJwQxIQFaRWyz3xn0ESItzBizsQ4yxfQiG37sFkMeQVnP5fHuc2+Z4JZ5SD56Dh1xxgnEw==
5144
```
5245

53-
NOTE: DO **NOT** SHARE YOUR PRIVATE KEY!
54-
55-
### Making a nickname with Key
56-
57-
To add a new nickname run ```add``` and follow the prompts:
58-
59-
```swsh
60-
Path to private key: C:\path\to\ssh\private.key
61-
Username: root
62-
Server: my.server.ssh
63-
Unique Nickname: server.ssh
64-
```
46+
### Importing SSH keys
6547

66-
### Making a nickname with Password
48+
If you already have SSH keys and want to use them instead of creating a new pair, you can! Use ```keygen import``` command to do so and just follow the prompts.
6749

68-
To add a new nickname run ```add -password``` and follow the prompts:
50+
NOTE: DO **NOT** SHARE YOUR PRIVATE KEY!
6951

70-
```swsh
71-
Username: root
72-
Server: my.server.ssh
73-
Unique Nickname: server.ssh
74-
```
52+
### Connecting to a host
7553

76-
### Connecting to server
54+
To connect run ```connect username@host```.
7755

78-
To connect run ```connect nickname```.
56+
To use a password connection, use tag `-p` like this: ```connect username@host -p```.
7957

80-
If done properly, output would be similar to the following (you will be asked for a password if you didn't add a key):
58+
If done properly, output would be similar to the following:
8159

8260
```swsh
83-
Waiting for response from usr@host...
84-
Connected to usr@host...
61+
Waiting for response from username@host...
62+
Connected to username@host...
8563
~:/ $
8664
```
8765

8866
## Commands
8967

90-
| Command | Description |
91-
|:--------------------------------------------------|:-----------------------------------------------------------------------|
92-
| [version](#version) | Check the version of swsh. |
93-
| [add [-password]](#add) | Add a new connection either using private key or password (-password). |
94-
| [show [nickname]](#show) | Show nicknames/Details of a nickname. |
95-
| [connect [nickname]](#connect) | Connects to Server over SSH. |
96-
| [delete [nickname]](#delete) | Deletes connection's nickname. |
97-
| [edit [nickname] [arg]](#edit) | Edits nickname, use one argument at a time. |
98-
| [keygen](#keygen) | Generates SSH RSA key pair. |
99-
| [help [command]](#help) | Displays this help or command details. |
100-
| [clear](#clear) | Clears the console. |
101-
| [pwd](#pwd) | Prints working directory. |
102-
| [computehash [(>/>>) path/to/file]](#computehash) | Uses SHA-1 hash function to generate hashes for SWSH and swsh-keygen. |
103-
| [exit](#exit) | Exits. |
104-
| [ls](#ls) | Lists all files and directories in working directory. |
105-
| [cd [arg]](#cd) | Changes directory to 'arg'. arg = directory name. |
106-
| [upload [args] [nickname]:[location]](#upload) | Uploads files and directories. 'upload -h' for help. |
68+
| Command | Description |
69+
|:------------------------------------------|:----------------------------------------------------------------------|
70+
| [version](#version) | Check the version of swsh. |
71+
| [connect [user@host] (-p)](#connect) | Connects to Server over SSH. |
72+
| [keygen (options)](#keygen) | Generates SSH RSA key pair. |
73+
| [help [command]](#help) | Displays this help or command details. |
74+
| [clear](#clear) | Clears the console. |
75+
| [pwd](#pwd) | Prints working directory. |
76+
| [computehash [(>/>>) path]](#computehash) | Uses SHA-1 hash function to generate hashes for SWSH and swsh-keygen. |
77+
| [exit](#exit) | Exits. |
78+
| [ls](#ls) | Lists all files and directories in working directory. |
79+
| [cd [arg]](#cd) | Changes directory to 'arg'. arg = directory name. |
80+
| [upload [arguments]](#upload) | Uploads files and directories. 'upload -h' for help. |
10781

10882
### version
10983

@@ -114,71 +88,32 @@ Checks the version of swsh.
11488
Usage: version
11589
```
11690

117-
### add
118-
119-
```swsh
120-
Syntax: add [-password]
121-
Add a new connection either using private key or password.
122-
123-
Usage to add using private key: add
124-
Usage to add using a password: add -password
125-
126-
You'll be asked for password each time as SWSH doesn't store them.
127-
```
128-
129-
### show
130-
131-
```swsh
132-
Syntax: show [nickname]
133-
Show nicknames if no arguments are given. If nickname is provided, shows details of a nickname.
134-
Usage to check all nicknames: show
135-
Usage to check a nickname: show myserver
136-
```
137-
13891
### connect
13992

14093
```swsh
141-
Syntax: connect [nickname]
142-
Connects to Server over SSH.
143-
Usage: connect myserver
144-
```
145-
146-
### delete
147-
148-
```swsh
149-
Syntax: delete [nickname]
150-
Deletes connection's nickname.
151-
Usage: delete myserver
152-
```
153-
154-
### edit
155-
156-
```swsh
157-
Syntax: edit [nickname] [arg]
158-
arg:
159-
-user [newUserName]
160-
-key [newKey]
161-
-server [newServer]
162-
Edits nickname, use one argument at a time.
163-
Usage: edit myserver -user newUSER
94+
Syntax: connect [user@host] (-p)
95+
Connects to Server over SSH. Use `-p` for password connection.
96+
Usage: connect root@server.ip
16497
```
16598

16699
### keygen
167100

168101
```swsh
169-
Syntax: keygen
170-
Generates SSH RSA key pair. Requires swsh-keygen.exe.
171-
102+
Syntax: keygen (options)
103+
Generates, imports or show SSH RSA key pair. Requires swsh-keygen.exe.
172104
Default values are provided in parentheses.
173-
Usage: keygen
105+
106+
Options:
107+
import - Imports RSA key pair.
108+
show [private] - Print RSA keys. By default, prints public key. Use `private` to print private key.
174109
```
175110

176111
### help
177112

178113
```swsh
179114
Syntax: help [command]
180115
Displays this help or command details.
181-
Usage: help add
116+
Usage: help pwd
182117
```
183118

184119
### clear
@@ -230,7 +165,7 @@ Usage: ls
230165
### cd
231166

232167
```swsh
233-
Syntax: cd
168+
Syntax: cd [arg]
234169
Changes directory to 'arg'. arg = directory name.
235170
236171
Usage: cd
@@ -239,10 +174,9 @@ Usage: cd
239174
### upload
240175

241176
```swsh
242-
Syntax: upload [--dir]* [args] [nickname]:[location]
243-
Uploads files and directories. 'upload -h' for help.
177+
upload [--dir]* [args] [user@host]:[location]
244178
245-
'args' are seperated using spaces ( ) and last 'arg' will be treated as server data which includes nickname as well as the location, part after the colon (:), where the data is to be uploaded. Use flag '--dir' to upload directiories. Do not use absolute paths for local path, change working directory to navigate.
179+
'args' are seperated using spaces ( ) and last 'arg' will be treated as server data which includes username and host location as well as the location of data to upload, part after the colon (:), where the data is to be uploaded. Use flag '--dir' to upload directiories. Do not use absolute paths for local path, change working directory to navigate.
246180
247-
Usage: upload --dir files nickname:/var/files
181+
Usage: upload --dir files root@43.22.56.111:/var/files
248182
```

ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A report should contain the following:
1111

1212
**Description**:
1313

14-
* SWSH Version: beta 3.0
14+
* SWSH Version: Titan
1515
* Windows 10 1709
1616
* .NET framework 4.7
1717

0 commit comments

Comments
 (0)