How do I update connection strings on a Linux server via SSH? Print
Submit Cancel
Email this article

Close

You are here: Home > Website Support > Passwords

To follow these instructions, you will need to enable SSH on the domain on your Dedicated server or email .(JavaScript must be enabled to view this email address) from your authorised email address to request that SSH be enabled.

  1. SSH onto the server:
    ssh [ftp_username]@servername/IP
    For example:
    ssh myftp@196.7.147.10 
  2. Access the website public directory:
    cd public_html 
  3. Search for your database or hostname:
    grep -ir 'dbname' 
    For 
    example:
    grep -ir 'myftp_db1' 
  4. Returns all files that contains the search criteria, see below example with 2 files:
    ./configuration.php:14:define('DB_USER''myftp_db1'); 
    ./
    twatch_include/userinfo.php:7$adl_dbuser='myftp_db1'
  5. You can edit the configuration file or password using vi:
    vi configuration.php 
    Search for the data you want to change:
    /'password'
    For example:
    /
    P@55w0rd 
  6. Press ‘insert’ (insert the new database name/hostname/password, replacing the old).
  7. Press ‘esc’
  8. ‘Shift” plus ‘:’
  9. On the bottom command line type: wq!
  10. You can then proceed to perform the same on other files found to contain the relevant information you wish to replace.

 

Was this information helpful?

Yes No

Thank you for your feedback
We are delighted to find that our article resolved your query.

Thank you for your feedback
We will resolve your query as soon as possible.

Please take a few moments to comment on your unresolved query. Simply tell us what your problem is. We guarantee that we'll get back to you within two hours (during office hours) in response to your query.


  Partially resolved    Unresolved
Enter your query here:
Your name:
Your email address:
Contact number:
Customer number or domain name:
 
Preferred contact method: Email     Call me
Please enter the text in the picture below into the text box:
CAPTCHA Image:
ID Number:
 
  • Hosting for Beginners

    Step-by-step guide to hosting with Hetzner.

    VIEW NOW
  • Application Tutorials

    Use our installation guides to get up and running.

    VIEW NOW
  • Login Now

    Our award winning proprietary control panel empowers customers to manage their hosting environment.

    Take the Tour
  • Contact Us

    support@hetzner.co.za

    Phone: 0861-0861-08
    Fax: 0861 0861-09
    Contact Us