Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to navigate and edit files in Putty
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to navigate and edit files in Putty

Special1Special1 Member
edited April 2016 in Help

Dear community!

I am new to Putty commands and I need some help. I have installed Wordpress app on Vultr server. Now I am trying to access my Wordpress files through Putty program.

I am trying to get and modify wp-config.php. How would I do that?

I typed "ls" in my Putty and I got this:

Could you tell me what commands should I do next to get to wp-config.php file?

I appreciate your help!

Comments

  • KuJoeKuJoe Member, Host Rep

    Run this command to find the wp-config.php file if you don't know where it is:
    find /home/ | grep wp-config.php

  • Special1Special1 Member
    edited April 2016

    @KuJoe said:
    Run this command to find the wp-config.php file if you don't know where it is:
    find /home/ | grep wp-config.php

    Thx for fast reply. I got nothing after I pressed enter:

  • TheOnlyDKTheOnlyDK Member
    edited April 2016

    You need to learn about Linux and bash before managing your own server, not knowing what you are doing is very dangerous.

    To answer your question, the wordpress install is probably in public_html folder, so "cd" (change directory) in to that and you can see the file (default there isn't one, it would be called wp-config-example.php or something similar). You can use nano/vi/vim to open the file, google on how to use those if you have no idea.

  • You can also run nano or vi to edit the file once you know its location. For example, if the file is located at /home/user/public_html/wp-config.php:

    nano /home/user/public_html/wp-config.php

  • Special1Special1 Member
    edited April 2016

    @TheOnlyDK said:
    You need to learn about Linux and bash before managing your own server, not knowing what you are doing is very dangerous.

    To answer your question, the wordpress install is probably in public_html folder, so "cd" (change directory) in to that and you can see the file (default there isn't one, it would be called wp-config-example.php or something similar). You can use nano/vi/vim to open the file, google on how to use those if you have no idea.

    Yes, I will definatelly start to learn, but I really need to find it.

    I entered public_html but it is empty? Or I might be wrong because I see one dot and 2 dots which I don't know what they represent?

  • bersybersy Member

    If I were you, I would rather take a look at WinSCP or any other analogue.

  • Looks like you may be running CPanel, if so you should just use their inbuilt GUI file editor.

  • BunnySpeedBunnySpeed Member, Host Rep
    edited April 2016

    If you're new, I'd maybe recommend you could use FileZilla and select the SFTP protocol and set something as Notepad++ as the main editor. After you edit the file and save it FileZilla automatically uploads it to the server.

  • RamiRami Member

    @bersy said:
    If I were you, I would rather take a look at WinSCP or any other analogue.

    +1

    Because if you even found the file through Putty you still have to learn how to use nano,vi or vim to edit it, So WinSCP or any other FTP client will be your best option for now

    Thanked by 1century1stop
  • TheOnlyDKTheOnlyDK Member
    edited April 2016

    @Special1 said:

    Try visiting your domain or IP and see what shows up. If nothing, run this command and see if there's any that comes up.

    find / -name 'wp-config*'

  • Special1Special1 Member
    edited April 2016

    @TheOnlyDK said:
    `find / -name 'wp-config*'

    It shows my wordpress site on that IP, so files should be somewhere, but where I don't know. I really want to find wp file from putty command. I tried your find command, but I am getting this:

  • @Special1 said:
    I tried your find command, but I am getting this:

    CTRL+C to quit that, I typed it wrong. Updated the comment. Missed the ` at the end.

  • @TheOnlyDK said:
    CTRL+C to quit that, I typed it wrong. Updated the comment. Missed the ` at the end.

    I did it, but it throws me on new line:

  • TheOnlyDKTheOnlyDK Member
    edited April 2016

    I spun up an instance, this is what I see.

    [root@vultr ~]# find / -name 'wp-config*'
    /var/ www/html/wp-config.php
    /var/ www/html/wp-config-sample.php
    

    There's this message in Vultr's control panel. Did you do these?

    WordPress Server Details
    
    1. Complete your WordPress installation by visiting this URL: 
    
    https://ip-address/wp-admin/
    User: coolusername
    Pass: justapassword
    
    2. Point your domain name "A record" to: ip-address
    
    3. Edit your "WordPress Address (URL)" and "Site Address (URL)" to match your domain name.
    
    This is located in WordPress Admin (/wp-admin/) -> Settings -> General
    
    Read more about this WordPress app on Vultr Docs
    https://www.vultr.com/docs/one-click-wordpress
    
    Thanked by 3Special1 Riz sayem314
  • MadMad Member
    edited April 2016

    The files are usually stored in "public_html" so if you want to reach it easier:

    cd public_html/

    ls

    If wordpress has not been installed in a subdirectory you'll find it here, then:

    vim wp-config.php

    While if you want to find out the exact location:

    find / -type f -name "wp-config*"

  • @TheOnlyDK said:
    I spun up an instance, got this message. Did you do anything? You should be able to find the config file AFTER you do this.

    > WordPress Server Details
    > 
    > 1. Complete your WordPress installation by visiting this URL: 
    > 
    > https://ip-address/wp-admin/
    > User: coolusername
    > Pass: justapassword
    > 
    > 2. Point your domain name "A record" to: ip-address
    > 
    > 3. Edit your "WordPress Address (URL)" and "Site Address (URL)" to match your domain name.
    > 
    > This is located in WordPress Admin (/wp-admin/) -> Settings -> General
    > 
    > Read more about this WordPress app on Vultr Docs
    > https://www.vultr.com/docs/one-click-wordpress
    > 

    I don't have that e-mail. I have server root and password. Wanted to access wp-config file through Putty, but if there is not possibility then I won't bother...

    @andreamada said:
    The files are usually stored in "public_html" so if you want to reach it easier:

    find / -type f -name "wp-config"

    This can not find anything which is weird since I have installed Wordpress site and it is live.

  • @Special1 said:

    @Special1 said:
    This can not find anything which is weird since I have installed Wordpress site and it is live.

    It's not an email, login to vultr, click on your server.

  • @TheOnlyDK said:
    It's not an email, login to vultr, click on your server.

    Oh I see it. Now I got access to whm and cpanel. Thx! I resolved my problem.

  • JRTechJRTech Member
    edited April 2016

    @Special1 said: Oh I see it. Now I got access to whm and cpanel. Thx! I resolved my problem.

    @andreamada's answer is correct. I am glad if you have found the solution.

    @andreamada said:

    find / -type f -name "wp-config"

    A bit correction:

    The correct command is:

    find / -type f -name "wp-config.php"

    Or if without .php :

    find / -type f -name '*wp-config*'

    Thanked by 1Mad
  • Regular bash will get you where you need to go, there isn't a ton of PuTTY specific stuff to know.

    Do keep in mind that right clicking the mouse in PuTTY will paste text into the terminal. I may or may not have pasted waaay too much info into IRC at one point.

  • BlazingServersBlazingServers Member, Host Rep
    edited April 2016

    cd public_html && yum -y install nano && nano wp_config.php

  • k0nslk0nsl Member
    edited April 2016

    Do you even read the topic before giving your advice?

    Anyway, try updatedb and then locate the file you need. Maybe that works.

    @BlazingServers said:
    cd public_html && yum -y install nano && nano wp_config.php

  • MadMad Member

    @JRTech said:

    My apologizes, I forgot to add "*" Thank you for your notice.

  • BlazingServersBlazingServers Member, Host Rep

    @k0nsl said:
    Do you even the topic before giving your advice?

    Yes. It looks like a cPanel installation. And he just wants to modify the wp_config.php page. So, he will navigate to public_html dir, then install nano and open it.

  • @BlazingServers said:
    Yes. It looks like a cPanel installation. And he just wants to modify the wp_config.php page. So, he will navigate to public_html dir, then install nano and open it.

    If you read from the top, I told him to check the folder. There's not such file in there, so he never ran the WordPress installer, which generates the file. Told him to check Vultr panel, and it's there now after running the install.

  • BlazingServersBlazingServers Member, Host Rep

    @TheOnlyDK said:
    If you read from the top, I told him to check the folder. There's not such file in there, so he never ran the WordPress installer, which generates the file. Told him to check Vultr panel, and it's there now after running the install.

    Oh...he didn't run the installer...oh...I get it...

  • @bersy said:
    If I were you, I would rather take a look at WinSCP or any other analogue.

    +1 for WinSCP

Sign In or Register to comment.