Currently Viewing Posts Tagged ssh

Failed to Read the contents of XML Resource: IDD_SSH_KEY_CHANGE_DIALOG

Dreamweaver 2019 does not connect to SFTP server and you see the “Failed to Read the contents of XML Resource: IDD_SSH_KEY_CHANGE_DIALOG” error.

1) Close the Dreamweaver application.

2) Go to the following location:

Windows: C:\Users\[user name]\AppData\Roaming\Adobe\Dreamweaver CC xxxx\en_US\Configuration
macOS: ~/Library/Application Support/Adobe/Dreamweaver CC xxxx/en_US/Configuration

Here, xxxx is the version of Dreamweaver. For example, if you are using Dreamweaver 2017 running on Windows, then your folder location reads:

C:\Users\[user name]\AppData\Roaming\Adobe\Dreamweaver CC 2017\en_US\Configuration

3) Right-click the ssh_hosts file, and rename this file. For example, ssh_hosts_old.

4) Relaunch Dreamweaver and connect to your SFTP server.

Hot to fix the problem on the new installation MariaDB

After the installation of MySQL server or MariaDB on Ubuntu, I would like to use phpMyAdmin or Adminer to access the MySQL server. But the first time the error comes like below.

Access denied for user ‘root’@’localhost’

mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’

MySQL connect error on phpMyAdmin

 

MySQL connect error on Adminer

Here is the solution to make the root connect to a server without error.

Continue reading “Hot to fix the problem on the new installation MariaDB”

How to SFTP your Google Computer Engine in Dreamweaver 2017

It is very strange that I can not use my private/public key pair to connect my VPS on Google Computer Engine. Although I can SFTP to the same VPS with same keys in Filezilla client, and PuTTY client.

I did a lot of try. At the last I found it is because I make the keys by PuTTY Key Generator program.

My PuTTY programs are the latest version 0.70.

It is the solution to tell you how to SFTP to Google Computer Engine in Dreamweaver 2017, or even Dreamweaver 2018.

Step 1, Generate public/private key pair

Run Git Bash terminal window.

I want to make the key by my name, binghuiyin

ssh-keygen -t rsa -b 2048 -C "binghuiyin"

Then it will ask for the location of the keys. I prefer to have them in d:/gce-key/ folder.

It will also ask for the passphrase. So I entered my password.

Done, I have two files in the d:/gce-key/

binghuiyin is the private key.

binghuiyin.pub is the public key.

ssh-keygen generate keys

 

 

Continue reading “How to SFTP your Google Computer Engine in Dreamweaver 2017”

Bashrc is not loading? (Fixed)

I have the .bashrc file, but it is not loading when I connect my VPS through SSH.

The content of .bashrc looks like below:

alias ls='ls --color=auto'
force_color_prompt=yes
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '

It provides a colorful terminal look.

How to fix the problem of .bashrc not loading?

Continue reading “Bashrc is not loading? (Fixed)”

How to enable SSH server in DD-WRT router

The router is Buffalo WZR-HP-G300NH2, flashed with DD-WRT v24-sp2 build 21676.

The SSH server settings is under Tab Services, Services.

dd-wrt-sshd-1

The section is called Secure Shell

dd-wrt-sshd-2

Select Enable for SSHd, keep the others as is. Then click Save and Apply Settings.

After that, you can use Putty to ssh to router. Let us have a look at my router.

dd-wrt-ssh-box

The login user name is root, not the one for web ui.

Password is the one to sign in web ui.

Stop mt-comments.cgi to save memory

I can not publish new post in this blog. So many 500 error when I click publish, some times when I click signin.
The 500 internal error is because my blog, MovableType ate a lot of memory when it running. The Dreamhost is monitoring the resource user is using. It will kill the thread when it over the limit. Actually they don’t tell you the limit of it. They just tell you, it is time to upgrade to their VPS.
I connected the server through ssh. Run top command to see which one is more popular.
Yes, I found it. More than one mt-comments.cgi stay on the list.
To temporary solve the problem, I rename the mt-comments.cgi to other name. Then sign in the backend of MoableType.
Click Settings, Feedback, Uncheck the check box after Accept Comments.
Then, republish the whole site.

Continue reading “Stop mt-comments.cgi to save memory”

How to block SSH connection per IP address

I have any VPS which is hosted on Burst.net.

The openssh server running on it. When I checked the error log. I saw a lot of log in errors as below.

It is clear that the hacker want to connect this VPS through SSH as root. They tried different password, different port. All were blocked by PAM system.

sshd-error-login-try

To save the cost of these connection and PAM. I choose the way to block them per IP address.

Continue reading “How to block SSH connection per IP address”

OpenSSH server Security Top 6

OpenSSH is very popular SSH server. Widely used on different Linux distribution. I used it for many years on my VPS server. It is easy to use, but security is the top issue for any server. Here is the top 6 security settings for Open SSH server.

To make it safe and minimize the risk, change the default setting and make it more safe.
OpenSSH setting file is located:

/etc/ssh/sshd_config

1) Only Use SSH Protocol 2
SSH protocol version 1 (SSH-1) has man-in-the-middle attacks problems and security vulnerabilities. SSH-1 is obsolete and should be avoided at all cost. Open sshd_config file and make sure the following line exists:

Protocol 2

2) Allow Only Specific Users or Groups (AllowUsers AllowGroups)
By default anybody who is authenticated successfully are allowed to login. Instead you can restrict which users (or groups) you allow to login to the system.

This is helpful when you have created several user accounts on the system, but want only few of them to login.

This is also helpful when you are using NIS, openLDAP (or some other external system) for authentication. Every user in your company might have account on NIS, OpenLDAP etc. But, on a specific server you want only few of them to login. For example, on production system you want only sysadmins to login.

Add the following entry to the sshd_config file to allow only specific users to login to the system. In the example below only ramesh, john and jason can login to this system. Usernames should be separated by space.

AllowUsers ramesh john jason

Add the following entry to the sshd_config file to allow only the users who belong to a specific group to login. In the exampe below only users who belong to sysadmin and dba group can login to the system.

AllowGroups sysadmin dba

Continue reading “OpenSSH server Security Top 6”

How to Synchonize files between two Dreamhost accounts

If you have two Dreamhost ftp account with SSH permission, and you want to transfer the content from account A to Account B, you need following script to do it.
It is simply one line shell command. I save it into a sh file. Schedule to run it every two hours.
Here is the script for you.
Name of Account A: ftp2010
Host name for ftp2010: hosting.mydomain.com
Name of Account B: ftp2011
Host name of ftp2011: hosting.yourdomain.com
The target is to transfer all files under ftp2010 to ftp2011 at hosting.yourdomain.com

Continue reading “How to Synchonize files between two Dreamhost accounts”

Large mySQL database transferring

To transfer the the large mySQL database, you need to learn how to use command to do it.
Large, means the database is bigger than 8 MB after compressing.
phpmyadmin, is a wonderful web tool for mySQL. But the limitation of upload is 8 MB. If the backup file is larger than it, you can not upload it, of course can not import it.
The platform I am working is Linux, Centos. It is ssh command environment.
1) Backup, export all tables of one database into one file.

mysqldump -u root -p databasename | gzip > backup.sql.tar.gz

I use this command to backup my forum database. The result is gzip file, means after compressing. I have a database is above 500MB. The gz file is about 125MB.
When I have the gz file, I can download it to my PC, or put it on other server for transferring.

Continue reading “Large mySQL database transferring”

  • Archives