Archives 2019

Change ssh port , CentOS 8

Cent OS support firewall-cmd & SeLinux, Its environment understood not easily. 
ssh port changing is very easy !
Edit /etc/ssh/sshd_config. Find “# Port 22″ and change to Port xxxx” (xxxx is your specified).

# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
Port xxxx <--- Change your specified port number.
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

if execute “sudo systemctl restart sshd.service”, you can find error messages. And execute “sudo systemctl status sshd.service”

 sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset:
 enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sat 2019-12-07 20
:37:23 EST; 33s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 3016 ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY (code=exited
, status=255)
 Main PID: 3016 (code=exited, status=255)

Dec 07 20:37:23 red systemd[1]: sshd.service: Failed with result 'exit-code'.
Dec 07 20:37:23 red systemd[1]: Failed to start OpenSSH server daemon.

You have to do 2 things.

  1. ssh service redefine.
  2. selinux setting.

 

Step1: Edit /usr/lib/firewalld/services/ssh.xml

<service>
<short>SSH</short>
<description>Secure Shell (SSH) is a protocol for logging into and executing commands on remote machines. It provides secure encrypted communications. If you plan on accessing your machine remotely via SSH over a firewalled interface, enable this option. You need the openssh-server package installed for this option to be useful.</description>
<port protocol="tcp" port="22"/> <--- Change your specified port number. </service>

Step 2: Execute following commands.

# semanage port -a -t ssh_port_t -p tcp xxxx <--- Change your specified port number.

 

Check & Restart openssh-server !

Ubuntu 18.04 phpmyadmin error

Browse data issues

Edit /usr/share/phpmyadmin/libraries/sql.lib.php
Line 613

        && ((empty($analyzed_sql_results['select_expr']))
|| (count($analyzed_sql_results['select_expr'] == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*')))
&& count($analyzed_sql_results['select_tables']) == 1;

Change Red to Blue

        && ((empty($analyzed_sql_results['select_expr']))
|| ((count($analyzed_sql_results['select_expr']) == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*')))
&& count($analyzed_sql_results['select_tables']) == 1;

Import/Export issues

Edit /usr/share/phpmyadmin/libraries/plugin_interface.lib.php
Line 551


$no_options = true;
if ($options != null && count($options) > 0) {
foreach ($options->getProperties()

Change Red to Blue

      $no_options = true;
if (! is_null($options) && count((array)$options) > 0) {
foreach ($options->getProperties()

Setup OneDrive in Ubuntu 18.04

Install OneDrive deb package.

$ sudo apt install onedrive

Sync OneDrive on user directory.

$ onedrive
Authorize this app visiting:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=xxxxxxxxxxxxxxxxxxxxxxxx&scope=files.readwrite%20files.readwrite.all%20offline_access&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient

Login to Your OneDrive Account then copy displayed URL of white page.
Paste to excution terminal.

enable user systemctl (daemonic).

After syncing, execute following daemon

$ systemctl --user enable onedrive
$ systemctl --user start onedrive

Reset Account or Change password or Login ID

$ systemctl --user stop onedrive

If do not need backup

$ rm -r .config/onedrive

else

$ mv .config/onedrive 'backup directory/'

reexcute ‘onedrive’ after these step.