• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

ftp

SCP

January 6, 2020

SCP is similar to the CP or copy command, but it’s done via a secure network.

Here’s a CP command.

cp /dir1/filename /dir2

cp /dir1/filename /dir2

You can use SCP to copy file to another system. It requires login.

scp /dir1/filename user@server:/home/user

scp /dir1/filename user@server:/home/user

This is using SCP to copy a file from 2 remote systems.

scp user@host1:/home/user/dir1/file.txt user@host2:/home/user/dir2

scp user@host1:/home/user/dir1/file.txt user@host2:/home/user/dir2

Filed Under: Linux Tagged With: cp, ftp, login, network, scp, secure

WordPress Asking for FTP Details

December 26, 2019

If WordPress is asking for FTP details when you’re trying to update a theme, plugin, or WordPress itself, you will need to edit your wp-config.php file to add the following line to your configuration.

define('FS_METHOD','direct');

define('FS_METHOD','direct');

Save the file and try updating again. It shouldn’t ask you for FTP details.

Filed Under: WP Tagged With: config, details, fix, ftp, plugin, theme, update, wordpress

Passive FTP Firewall

November 18, 2019

Passive FTP is a FTP mode that alleviates the issues with client firewalls. The client initiates a call to the server. The return traffic is allowed as long as the client has initiated it. In addition, the server sends a port command along with an ephemeral port that the client can connect to. The client initiates a call on that ephemeral port, and the connection is then established.

Egress port 21 and ephemeral ports 1024-65535 needs to be opened from the client side.

# From the client side, egress port 21 must be open.
tcp:21
# From the client side, ephemeral ports from port 1024 to 165535 must be open.
tcp:1024-165535

# From the client side, egress port 21 must be open. tcp:21 # From the client side, ephemeral ports from port 1024 to 165535 must be open. tcp:1024-165535

Filed Under: Cloud Tagged With: aws, ephemeral, firewall, ftp, gcp, high, passive, port

Add Files in WordPress Without FTP

March 22, 2016

I’m working on a client site running WordPress but without any access to FTP. It’s an interesting dilemma because WordPress will allow you to add new themes and plugins via its interface. It does so by allowing you to upload zipped files of the themes and plugins. Obviously, you don’t want to keep doing this especially you want to add just one file to the theme.

I needed to create a new page template on the Genesis platform. My client is using the Enterprise Pro child theme. There’s a command in PHP called ‘touch’ which allows you to create a new file. You can insert this command on the top of your theme’s header file in WordPress. Since I’m using Genesis, the child theme doesn’t have a header, therefore I had to do insert the command in the parent theme.

In the WordPress Dashboard under Appearance, choose the Editor. On the top right-hand side of the page, select the Genesis parent theme from the dropdown menu to edit. Click on the ‘Theme Header’ to edit, and add this line of code on top of the header.php file.

touch('wp-content/themes/enterprise-pro/template.php');

touch('wp-content/themes/enterprise-pro/template.php');

The command has to run once, so you’ll need to access the website at least once. Remove the line of code afterwards. The PHP ‘touch’ function will create a new empty file called template.php inside the Enterprise Pro theme. You can check it by navigating the editor once again, and selecting this time the ‘Enterprise Pro’ theme. Look for the new file called ‘template.php.’

In my case, I decided to change the page template to another filename, so I ended running it for the second time by inserting the rename function on the header.php file once again. Here’s the command to rename template.php to newtemplate.php.

rename('wp-content/themes/enterprise-pro/template.php', 'wp-content/themes/enterprise-pro/newtemplate.php');

rename('wp-content/themes/enterprise-pro/template.php', 'wp-content/themes/enterprise-pro/newtemplate.php');

Anyway, it works, but use this with extreme caution. If you’re not familiar with PHP and WordPress, you can render the entire website useless if you somehow inserted the wrong PHP code. There’s no FTP to back out the files. The WordPress Dashboard may no longer work. So, work on your own peril.

Filed Under: WP Tagged With: add file, ftp, header

530 Incorrect Login Error On Vsftpd

August 9, 2013

I installed a FTP server called vsftpd on my Ubuntu Server recently. After the install, I’ve been unable to login at all. It turned out to be a bug within the vsftpd program. I found a fix here. Essentially, the fix was removing the vsftpd program first, deleting the /etc/pam.d/vsftpd file and forcing the application to recreate the file. The third step is to reinstall the vstfpd once again.

From the Terminal, type the following commands.

sudo apt-get remove vsftpd
sudo rm /etc/pam.d/vsftpd
sudo apt-get install vsftpd

sudo apt-get remove vsftpd sudo rm /etc/pam.d/vsftpd sudo apt-get install vsftpd

After making the changes, I was able to log in successfully using the Filezilla client. Success.

Filed Under: Linux Tagged With: ftp, vsftpd

  • Home
  • About
  • Archives

Copyright © 2023