Facility AUTHPRIV varlogsecurePermit. Root. Login yesPermit. Root. Login no rootPermit. Empty. Passwords noPermit. Empty. Passwords no SSH etcrc. SSHchrootroot mkdir p bin vi binchroot useradd binbash Usage. Here specify the apps you want into the enviroment. CMDbash ls touch mkdir cp mv rm pwd chmod cat vi id rsync ssh scp sftp ping ssh keygen perlAPPSwhich CMDAPPSAPPS usrlibexecopensshsftp server Sanity checkif 1 thenecho Usage. Obtain username and Home. Dir. CHROOTUSERNAME1if 2 thenuseradd CHROOTUSERNAMEelseuseradd s 2 CHROOTUSERNAMEfiusermod d homeCHROOTUSERNAME. CHROOTUSERNAMEpasswd CHROOTUSERNAMEchown CHROOTUSERNAME homeCHROOTUSERNAMEchgrp CHROOTUSERNAME homeCHROOTUSERNAMErm f homeCHROOTUSERNAME. HOMEDIRgrep etcpasswd e CHROOTUSERNAME cut d f 6cd HOMEDIR Create Directories no one will do it for youmkdir p etcmkdir p binmkdir p usrbinmkdir p usrlocalbinmkdir p usrlibexecopensshmkdir p publichtml chown CHROOTUSERNAME homeCHROOTUSERNAMEpublichtml chgrp CHROOTUSERNAME homeCHROOTUSERNAMEpublichtml MAKEDEV d dev x null zero Create short version to usrbingroups On some system it requires binsh, which is generally unnessesary in a chroot cageecho binbash usrbingroupsecho id Gn usrbingroupschmod 7. Add some users to. CHROOTUSERNAME etcpasswdgrep etcgroup e root e CHROOTUSERNAME etcgroup Copy the apps and the related libsfor prog in APPS docp prog. LIBSldd prog awk print 3 for l in LIBS domkdir p. From some strange reason these 4 libraries are not in the ldd output, but without them some stuff will not work, like usrbingroupscp liblibnsscompat. USERchroot pwdroot su root bash su command not found.
Disable Windows Authentication In Iis7 Ftp© 2017