If a user wishes to use SCP and SFTP on a Linux server running cPanel they will need to have shell access enabled. Wildcards can be used for both sending and receiving files. SCP can also be used with wildcard statements (*) to transfer multiple files that meet your criteria:Ĭopies all files ending in.php in the /home/bob/public_html directory to the local directory called Downloads. Scp index.php scp the local file index.php to the directory /home/bob/public_html/ on the server as the user bob.Ĭopies the file index.php from its location on the server to the local directory called Downloads as the server user bob. Because it uses the SSH protocol for authentication SCP is more secure than FTP which transmits passwords in plain text. The SCP command can be used to send a file to a server or retrieve a file from a server. To send or receive files simply drag them from one pane to another. The majority of them use a two pane window view, with one pane being the local file system and the other pane showing the server’s file system. Many SFTP clients are almost exactly the same in appearance as FTP clients. SFTP differs from SCP in that it offers a GUI component that allows more remote administration, akin to a remotely accessed file system. SFTP is not FTP over SSH, but instead a new protocol developed from the ground up. SFTP can work with many protocols but is most commonly used with SSH to provide secure authentication. Enabling that seems to fix most issues I had. now give the correct 'myusername'.Įdit: There is also another Apache Module mod_suphp that may be required to fix issues with some scripts.One simple way to improve your Linux server’s security is to use SFTP or SCP instead of regular FTP. Mod_suexec is an Apache Module that can be enabled in EasyApache4. If you uninstall the suEXEC module, the system executes PHP applications as the nobody system user.' Apache mod_userdir Tweak in WHM still has 'DefaultHost (nobody)'.Īnother clue here: 'If you install the suEXEC module, the system executes PHP applications as the user that owns the VirtualHost that served the request. One site that was giving me nasty 500 server errors is suddenly back, but that could also be because I changed permissions on all folders to 777 - bad for security. is still giving me 'nobody' as Apache user. usr/local/cpanel/scripts/restartsrv_httpd usr/local/cpanel/scripts/rebuildhttpdconf Tried changing 'nobody' to 'myusername' in pre_main_nf, empty file with only this:Īnd then run these two commands from root in SSH to rebuild nf and restart Apache: # These are hard-coded values that are required by cPanel & WHM # /etc/apache2/conf.d/includes/post_virtualhost_nf # /etc/apache2/conf.d/includes/pre_virtualhost_nf # /etc/apache2/conf.d/includes/pre_main_nf # To have your modifications retained, you should create/edit administrator-specific # regeneration of this configuration file, or an Apache update. # Direct modifications to the Apache configuration file WILL be lost upon subsequent USE INCLUDE FILES IF YOU NEED TO MAKE A CHANGE Can I change DefaultHost to 'myusername' anywhere? WHM has Apache mod_userdir Tweak where only 'DefaultHost (nobody)' has 'Exclude Protection' selected and all my other hosts/website have 'myusername'. I see my Apache now runs as 'nobody' I think it used to be/should be 'myusername'? My PW sites were installed as 'myusername' and all folders/files are owned by that 'myusername'.Įdit: EasyApache apparently "updates" user settings or PHP handlers (?) and you have to turn that off? Here is a possible way to make Apache run as 'username' instead of 'nobody', I think, from 2012, so not risking that one. I'll see if I can fix my problem with that, but they're not clearcut instructions what ownership and permissions each folder/file should have. Here's one via a Google search - also uses CentOS, but with Apache vs Nginx issue, so problably not relevant. I'm trying to find out where and created this thread to find out if anyone had seen something similar after PHP config changes. Of course there is a misconfiguration somewhere. I have not improvised anything, not made any manual configuration changes. use EasyApache4 just standardized automated upgrade/changes on a VPS with a few PW websites that have been running fine for years. Edit: Solution is at the end of this comment, after a few educational dead ends.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |