At line 1 changed one line |
Every linux distro is slightly different. This guide is intended to cover the basics and show you around some of the ways you can configure and work with CrushFTP. |
Every linux distro is slightly different. This guide is intended to cover the basics and show you around some of the ways you can configure and work with CrushFTP. You can try the single line in Linux for an automated download and install...may work on most distros.\\ |
{{{ |
wget -O - https://www.crushftp.com/crush9wiki/attach/Linux%20Install/configure.sh | bash |
}}} |
At line 7 changed one line |
First, make sure Java is installed properly. By default most linux distros come with a free version of Java that won't work with CrushFTP. Make sure its an official Sun java, or other suitable JVM. |
First, make sure Java is installed properly. By default most linux distros come with an open source version of Java that may not work with CrushFTP. Make sure its an official OpenJDK java, or other suitable JVM. |
At line 15 changed one line |
To run Java, you may need to specify the full path to the java binary. Something possibly like /usr/java/jre1.5.0_11/bin/java. Its going to depend on where you installed it. |
To run Java, you may need to specify the full path to the java binary. Something possibly like /usr/java/jre1.8.0_191/bin/java. Its going to depend on where you installed it. |
You can also install open java 13 as that works just fine as well. |
At line 22 added 2 lines |
Extract CrushFTP folder ideally into /var/opt/ so it's an easier approach if you have issues finding it over time. |
|
At line 20 changed one line |
There is a script provided to give you the basics of starting and stopping CrushFTP. It might be overkill for your situation, but you are welcome to use it and modify it for your needs. The script is "[crushftp_init.sh|crushftp_init.sh]". You must edit the script the first time you use it to set the correct path in it. Additionally, make a copy of the script file as CrushFTP updates will overwrite it. |
There is a script provided to give you the basics of starting and stopping CrushFTP. It might be overkill for your situation, but you are welcome to use it and modify it for your needs. The script is crushftp_init.sh. Its included with your download of CrushFTP already. You must edit the script the first time you use it to set the correct path in it. |
At line 31 added one line |
__Install / Uninstall CrushFTP__ |
At line 26 changed one line |
__Alternate Start CrushFTP Method__ |
There is a script provided to give you the automated process supported on most Linux distro's of installing and uninstalling CrushFTP. The script is crushftp_init.sh. |
At line 28 changed one line |
The key here is making sure you are in the CrushFTP directory (so its the working directory), and using the "-d" option to start in daemon mode. If you are not in the right directory when you start CrushFTP, it will start generating a new prefs.xml file and users folder from the new location where you started it. |
{{{./crushftp_init.sh install |
./crushftp_init.sh uninstall}}} |
At line 30 removed 3 lines |
{{{ |
sudo java -Dcrushftp.version=5 -jar CrushFTP.jar -d |
}}} |
At line 34 changed one line |
You may also want to start it so it stays running even when you logout. |
__Generating an Admin User__ |
At line 36 changed 3 lines |
{{{ |
sudo nohup java -Dcrushftp.version=5 -jar CrushFTP.jar -d& |
}}} |
While you technically can do everything with CrushFTP from the command line and editing text XML files, its much easier to use a web browser to do this. You just need to have an admin user created first. |
At line 43 added one line |
To make your user for doing this, use a command like this (avoid special characters in the comamnd line password creation): |
At line 41 removed 2 lines |
The "-?" option will list various command line options you can use: |
|
At line 44 changed one line |
java -jar CrushFTP.jar -? |
java -jar CrushFTP.jar -a "crushadmin" "password" |
At line 48 changed one line |
__Generating an Admin User__ |
This will make a new user, and write it to the default location: |
At line 50 changed one line |
While you technically can do everything with CrushFTP from the command line and editing text XML files, its much easier to use a GUI to do this. You can use remote administration with CrushFTP in order to remote control a headless server. This lets you have a full GUI controlling the headless linux installations of CrushFTP. |
{{''users/MainUsers/crushadmin/''}} |
At line 52 changed one line |
To make your user for doing this, use a command like this: |
You can now login to the administration console using a web browser. The default ports are: |
At line 54 changed 3 lines |
{{{ |
java -jar CrushFTP.jar -a "remoteadmin" "mypassword" |
}}} |
{{{http://your_ip:8080/ |
https://your_ip:443/}}} |
At line 59 added one line |
[Install Video|http://www.crushftp.com/videos/linux_install.mp4] | [Quick Start Video|http://www.crushftp.com/videos/quick_start.mp4]\\ |
At line 59 changed one line |
This will make a new user, and write it to the default location: |
__Alternate Start /Stop CrushFTP Methods__ |
At line 61 changed one line |
{{''users/lookup_21/remoteadmin/''}} -- or -- {{''users/MainUsers/remoteadmin/''}} |
You may also want to start it so it stays running even when you logout. |
At line 63 changed one line |
Since this is CrushFTP5, you will want to move this user to the proper location if it was generated to the 'lookup_21' folder: |
{{{ |
sudo nohup java -jar CrushFTP.jar -d& |
}}} |
At line 65 removed one line |
{{''users/MainUsers/''}} |
At line 67 changed one line |
You can then login using this username from a ftp client, or via the remote admin interface of CrushFTP. I recommend using remote admin using HTTP over port 8080. For FTP to work, you may need to adjust the 'passive' IP in the server preferences if CrushFTP has detected the wrong IP on your machine. |
The "-?" option will list various command line options you can use: |
At line 69 changed one line |
[https://www.crushftp.com/Docs/Videos/Running_as_a_Service_and_Remote_Administration.mov] |
{{{ |
java -jar CrushFTP.jar -? |
}}} |
At line 71 removed one line |
[https://www.crushftp.com/Docs/Videos/Linux_Install.mov] |
At line 73 removed 5 lines |
The basics are opening CrushFTP, clicking manage servers button in the upper right. Add a new item, click on it and set the URL to match the credentials of the user you just made. ''http://remoteadmin:mypassword@192.168.x.x:8080/'' Click apply, then click OK to close the manage servers window. Finally, select your server from the drop down and wait as CrushFTP connects to your server and gives you a remote admin interface to the GUI of the headless server. |
---- |
|
__Alternate Stop CrushFTP Method__ |
|
At line 80 changed one line |
You can also do it from a script. Let me explain. CrushFTP supports the "SITE QUIT" command if it has been enabled in the User Manager under the Admin tab for a user. So you can have a scripted command that simply logs into the server, issues SITE QUIT, then logs out. The server will then gracefully quit saving any unsaved data to disk before exiting. |
You can also do it from a script. CrushFTP supports the "SITE QUIT" command if it has been enabled in the User Manager under the Admin tab for a user. So you can have a scripted command that simply logs into the server, issues SITE QUIT, then logs out. The server will then gracefully quit saving any unsaved data to disk before exiting. |
At line 92 changed one line |
quote user remoteadmin |
quote user crushadmin |
At line 98 changed one line |
Provided a user named "remoteadmin" exist, and they have permission to execute that command, CrushFTP will terminate once the user logs out. |
Provided a user named "crushadmin" exist, and they have permission to execute that command, CrushFTP will terminate once the user logs out. |
At line 105 changed one line |
java -jar CrushFTP.jar -p thePassword DES |
java -jar CrushFTP.jar -p DES thePassword |
At line 106 added 129 lines |
__Running as non-root (not recommanded)__ |
\\ |
\\ |
|
This method details how to run from rc.local on a systemd init based Linux flavor. Running as a non-root user won't allow binding to ports below 1024, will need to use NAT or port rewrite rules in iptables to be able to server on IANA defined well known ports. |
|
Running crush in user mode as "crushftp" system user, by adding below lines into rc.local (generic method) |
{{{ |
su - crushftp -c '/var/opt/CrushFTP9_PC/crushftp_init.sh start' |
exit 0 |
}}} |
\\ |
This may be required in case daemon mode doesn't output to nohup.out, in this case modify the init script as |
\\ |
{{{ |
$NOHUP $JAVA -Ddir=$CRUSH_DIR -Xmx384M -jar plugins/lib/CrushFTPJarProxy.jar -d 2>>nohup.out & |
|
}}} |
\\ |
\\ |
Running in user mode on systemd RHEL 7/8 family Linux |
\\ |
First in crushftp_init.sh will need to set the user as "crushftp" ( or whatever non-root user) then allow rc-local.service to be able to run ( needed for compatibility mode, non root user) |
\\ |
{{{ |
touch /etc/systemd/system/rc-local.service |
vi /etc/systemd/system/rc-local.service |
}}} |
\\ |
paste into below |
\\ |
{{{ |
[Unit] |
Description=/etc/rc.local Compatibility |
ConditionPathExists=/etc/rc.local |
|
[Service] |
Type=forking |
ExecStart=/etc/rc.local start |
TimeoutSec=0 |
StandardOutput=tty |
RemainAfterExit=yes |
SysVStartPriority=99 |
|
[Install] |
WantedBy=multi-user.target |
|
}}} |
\\ |
|
then edit /etc/rc.local |
\\ |
{{{ |
vi /etc/rc.local |
}}} |
\\ |
add in |
\\ |
{{{ |
su crushftp /var/opt/CrushFTP9_PC/crushftp_init.sh start |
exit 0 |
}}} |
\\ |
then make it executable |
\\ |
{{{ |
chmod +x /etc/rc.local |
}}} |
\\ |
then install the rc.local service |
\\ |
{{{ |
systemctl enable rc-local.service |
}}} |
\\ |
reboot, check if OK |
\\ |
\\ |
\\ |
Obsolete system V init method |
\\ |
\\ |
create new scriptfile |
\\ |
{{{ |
touch /etc/init.d/crushftp |
}}} |
\\ |
add this script to /etc/init.d/crushftp |
\\ |
{{{ |
#!/bin/bash |
#!/bin/sh |
# |
# Control script for CrushFTP v1.4 running as crushuser |
# |
# chkconfig: - 86 14 |
# description: CrushFTP |
# |
# BEGIN INIT INFO |
# Provides: crushftp |
# Required-Start: $local_fs |
# Should-Start: $network |
# Required-Stop: |
# Should-Stop: $network |
# Default-Start: 2 3 5 |
# Default-Stop: 2 5 |
# Short-Description: CrushFTP Server |
# Description: Starts Crush on boot |
# END INIT INFO |
|
runuser crushuser -c "/var/opt/CrushFTP9_PC/crushftp_init.sh $1" |
|
################################################################ |
}}} |
\\ |
make it executable |
\\ |
{{{ |
chmod 755 /etc/init.d/crushftp |
}}} |
\\ |
install service |
\\ |
{{{ |
chkconfig --add crushftp |
chkconfig crushftp on |
service crushftp start |
}}} |