Compare commits

...

4 Commits
1.0 ... master

Author SHA1 Message Date
Govindas a7af039799 Document SSH key setup 2022-08-30 17:55:10 +00:00
ham1255 1de122e659 Update 'README.md' 2022-07-09 12:46:47 +00:00
mohammed jasem alaajel 1b9dd87efb added a comment 2022-06-17 06:47:01 +04:00
mohammed jasem alaajel 668dd05eac fixed a mistake 2022-06-17 06:43:26 +04:00
3 changed files with 11 additions and 8 deletions

View File

@ -2,15 +2,20 @@
before using the plugin those steps were made on a linux machine not sure about windows before using the plugin those steps were made on a linux machine not sure about windows
but those might work on any unix system like bsd or freebsd but those might work on any unix system like bsd or freebsd
And also this was made for shared hosting only, not meant on dedicated as you control the operating system
# How to setup on |*ssh server in linux*| # How to setup on |*ssh server in linux*|
* create user in your system using the command provided below * create user in your system using the command provided below
``useradd xrambad --shell=/bin/true`` ``useradd appletunnel --shell=/bin/true``
this will make the user have no shell + sftp and scp access. this will make the user have no shell + sftp and scp access.
* create ssh key for the user. * Create SSH key for the user:
- Login into the created user
- Execute `ssh-keygen`
- Leave the passphrase empty during ssh key creation
- Append ~/.ssh/id_rsa.pub contents to ~/.ssh/authorized_keys file, if authorized_keys file does not exist, create it
* there will be issue that user can't login to fix this * there will be issue that user can't login to fix this
add ``/bin/true`` to ``/etc/shells`` add ``/bin/true`` to ``/etc/shells``
@ -21,7 +26,7 @@ add ``/bin/true`` to ``/etc/shells``
[09:16:17 WARN]: [AppleTunneler] no Identities files found, please put them in plugins/AppleTunneler/Identities [09:16:17 WARN]: [AppleTunneler] no Identities files found, please put them in plugins/AppleTunneler/Identities
[09:16:17 ERROR]: Error occurred while enabling AppleTunneler v1.0-SNAPSHOT (Is it up to date?) [09:16:17 ERROR]: Error occurred while enabling AppleTunneler v1.0-SNAPSHOT (Is it up to date?)
``` ```
* place your user that you created private key into ``plugins/AppleTunneler/Identities`` folder * put your created user's private key in ``plugins/AppleTunneler/Identities`` folder
* start server again, but you will be met with another error as shown below * start server again, but you will be met with another error as shown below
``` ```
@ -33,7 +38,6 @@ add ``/bin/true`` to ``/etc/shells``
* run this command to create the host file * run this command to create the host file
``ssh-keyscan limework.net >> /home/test/Desktop/test-server/plugins/AppleTunneler/.known_hosts`` ``ssh-keyscan limework.net >> /home/test/Desktop/test-server/plugins/AppleTunneler/.known_hosts``
* now modify the config of the plugins for your needs by setting host, port, username of ssh server and setting tunneling needed. * now modify the config of the plugins for your needs by setting host, port, username of ssh server and setting tunneling needed.
and done. and done.

View File

@ -40,10 +40,7 @@ public class AppleTunneler extends JavaPlugin {
} }
File[] files = file.listFiles(); File[] files = file.listFiles();
if (files == null) { if (files == null || files.length == 0) {
return;
}
if (files.length == 0) {
getLogger().warning("no Identities files found, please put them in " + file.getPath()); getLogger().warning("no Identities files found, please put them in " + file.getPath());
throw new RuntimeException("no Identities files found"); throw new RuntimeException("no Identities files found");
} }
@ -63,6 +60,7 @@ public class AppleTunneler extends JavaPlugin {
private void loadKnownHostFile() throws FileNotFoundException, JSchException { private void loadKnownHostFile() throws FileNotFoundException, JSchException {
File knownHosts = new File(getDataFolder(), ".known_hosts"); File knownHosts = new File(getDataFolder(), ".known_hosts");
// check whatever known hosts file is folder somehow if so delete it.
if (knownHosts.isDirectory()) { if (knownHosts.isDirectory()) {
knownHosts.delete(); knownHosts.delete();
} }

View File

@ -3,6 +3,7 @@
# username for ssh # username for ssh
username: apple username: apple
# host eg: domains can be used. # host eg: domains can be used.
# host: idk.example.com
host: 192.168.0.100 host: 192.168.0.100
# ssh port # ssh port
port: 22 port: 22