How do I update connection strings on a Linux server via SSH?
Print Email
Email this article
Close
Email this article
CloseYou 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.
- SSH onto the server:
ssh [ftp_username]@servername/IP
For example:
ssh myftp@196.7.147.10 - Access the website public directory:
cd public_html - Search for your database or hostname:
grep -ir 'dbname' *
For example:
grep -ir 'myftp_db1' * - 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'; - You can edit the configuration file or password using vi:
Search for the data you want to change:
vi configuration.php/'password'
For example:
/P@55w0rd - Press ‘insert’ (insert the new database name/hostname/password, replacing the old).
- Press ‘esc’
- ‘Shift” plus ‘:’
- On the bottom command line type:
wq! - 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 NoThank 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.
