Documentation to create and install
1 - Introduction
2 - Install and update of MySecureShell
3 - Preparing sources
4 - Compilation from sources
5 - Build package (Optional)
6 - Installation from sources
7 - Add users for MySecureShell
8 - Uninstall
MySecureShell is a program with use very secure SSH with it's "sftp-server". MySecureShell is a shell which permit 'add functionalities to sftp-server (similar to ProFtpd).
Install and update of MySecureShell |
Before starting you have to know your OS. If you're a beginner, you should prefer package for your system.
First, download sources of MySecureShell and deflate archive (replace X by version). tar -xzvf MySecureShell-X_source.tgz cd MySecureShell-X_source
Additional options available :
Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-conffile=xxx Change config file (default: /etc/ssh/sftp_config) --with-logfile=xxx Change log file (default: /var/log/sftp-server.log) --with-logcolor=xxx Active color in log file (default: no) --with-shutfile=xxx Change shut file (default: /etc/sftp.shut) --with-admin=xxx Disable remote admin (default: yes) Here a little descriptions of this options :
--with-PACKAGE[=ARG] : --without-PACKAGE : --with-conffile=xxx : Change configuration file. --with-logfile=xxx : Change log file. --with-logcolor=xxx : Add color to log. --with-shutfile=xxx : Change file of sftp.shut. --with-admin=xxx : Remove remote administration of MySecureShell.
Now you can do command "./configure" (with your options): ./configure --with-logcolor=yes checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for sed... /bin/sed checking for kvm_open in -lkvm... no checking for stringprep_convert in -lidn... no checking for an ANSI C-conforming const... yes checking how to run the C preprocessor... gcc -E ............ If it's ok, you should see : MySecureShell has been configured with the following options: Log file: /var/log/sftp-server.log (color: yes) User binaries: /usr/bin Shutdown file: /etc/sftp.shut Configuration file: /etc/ssh/sftp_config
Supported: Remote Admin : yes UTF-8 Encoding : yes
Now you should build MySecureShell with command "make all" : make all Compile [main.c] Compile [string.c] Compile [parsing.c] Compile [hash.c] Compile [conf.c] Compile [convert.c] Compile [user.c] Compile [prog.c] Compile [ip.c] Compile [SftpWho/Main.c] Compile [SftpServer/SftpWho.c] Compile binary [util /sftp-who] Compile [SftpState/Main.c] Compile binary [utils/sftp-state] Compile [SftpServer/Buffer.c] Compile [SftpServer/Encode.c] Compile [SftpServer/Handle.c] Compile [SftpServer/Send.c] Compile [SftpServer/Sftp.c] Compile [SftpServer/Util.c] Compile [SftpServer/Log.c] Compile binary [MySecureShell] Compile [SftpAdmin/Main.c] Compile binary [utils/sftp-admin] Sometimes it's possible to see: user.c: In function 'init_user_info': user.c:97: warning: pointer targets in passing argument 3 of 'getgrouplist' differ in signedness SftpServer/Access.c:92: warning: pointer targets in passing argument 3 of 'getgrouplist' differ in signedness Don't worry, it's okay. Now MySecureShell is ready to installed.
If you want to create a package use command "make package": Delete all objects Delete all unecessary files Compile [main.c] Compile [string.c] Compile [parsing.c] Compile [hash.c] Compile [conf.c] Compile [convert.c] Compile [user.c] Compile [prog.c] Compile [ip.c] Compile [SftpWho/Main.c] Compile [SftpServer/SftpWho.c] Compile binary [utils/sftp-who] Compile [SftpState/Main.c] Compile binary [utils/sftp-state] Compile [SftpServer/Buffer.c] Compile [SftpServer/Encode.c] Compile [SftpServer/Handle.c] Compile [SftpServer/Send.c] Compile [SftpServer/Sftp.c] Compile [SftpServer/Util.c] Compile [SftpServer/Log.c] Compile binary [MySecureShell] Compile [SftpAdmin/Main.c] Compile binary [utils/sftp-admin] Make package Tar package Package done. At the end you have a package nammed mysecureshell-X.tar.gz.
Installation from sources |
You should be "root" to continue.
First binaries : File "MySecureShell" must be copied to "/bin" with rights 4755. Configuration file "sftp_config" should be created with rights 644 and placed in "/etc/ssh" or "/etc/sshd" (depends of your os). After add shell MySecureShell as valid shells in file "/etc/shells" (only if this file exists in your os).
Second MySecureShell utilities : Copy files from directory "utils" into "/usr/bin". With rights : - 755 on "sftp-who", "sftp-kill", "sftp-verif" and "sftp-user" - 700 on "sftp-state" and "sftp-admin" cp -f ./MySecureShell /bin chmod 4755 /bin/MySecureShell cp -f ./sftp_config /etc/ssh chmod 644 /etc/ssh/sftp_config echo "/bin/MySecureShell" >> /etc/shells cp ./utils/* /usr/bin chmod 755 /usr/bin/sftp-who /usr/bin/sftp-kill /usr/bin/sftp-verif /usr/bin/sftp-user chmod 700 /usr/bin/sftp-state /usr/bin/sftp-admin Now, MySecureShell is installed !
Add users for MySecureShell |
Create users and groups and edit file "/etc/passwd" (as root). su - vi /etc/passwd Change columns "shells" and replace it by "/bin/MySecureShell". Sample : msstest:x:1006:500:MMS Testing:/home/sftpusers/msstest:/bin/sh Become : msstest:x:1006:500:MMS Testing:/home/sftpusers/msstest:/bin/MySecureShell Save and quit.
Why uninstall MySecureShell ? Use script "Uninstall.sh" (included with sources) !
In this case, MySecureShell team want to known the reasons, please mail : teka2nerdman@users.sourceforge.net
|