Compare commits

..

No commits in common. "master" and "1.0" have entirely different histories.
master ... 1.0

3 changed files with 8 additions and 11 deletions

View File

@ -2,20 +2,15 @@
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
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*|
* create user in your system using the command provided below
``useradd appletunnel --shell=/bin/true``
``useradd xrambad --shell=/bin/true``
this will make the user have no shell + sftp and scp access.
* 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
* create ssh key for the user.
* there will be issue that user can't login to fix this
add ``/bin/true`` to ``/etc/shells``
@ -26,7 +21,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 ERROR]: Error occurred while enabling AppleTunneler v1.0-SNAPSHOT (Is it up to date?)
```
* put your created user's private key in ``plugins/AppleTunneler/Identities`` folder
* place your user that you created private key into ``plugins/AppleTunneler/Identities`` folder
* start server again, but you will be met with another error as shown below
```
@ -38,6 +33,7 @@ add ``/bin/true`` to ``/etc/shells``
* run this command to create the host file
``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.
and done.

View File

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

View File

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