Monday, December 2, 2019

How SFTP Connection Error Received unexpected end-of-file from SFTP server ?

I have Spent couple of days searching for this and before i gave up  I was able to solve my issue by logging into SSH and editing the sshd_config file:
sudo nano /etc/ssh/sshd_config
Then scroll down until you see this line:
# Subsystem sftp /usr/lib/openssh/sftp-server
Leave that line commented out, but underneath it write this:
Subsystem sftp internal-sftp
Then either power cycle your server or  just do service sshd restart and the problem should be fixed. I’m now using the latest version of Filezilla without any issues.

As a note: You may need to change/add the ForceCommand in the user/group match block to use internal-sftp as well:
Match User someuser
    ..... other stuff .....
    ForceCommand internal-sftp
This fix Also Mobaexterm 

SFTP error code 103 so Both FileZilla and Mobaexterm is working Now :-)

Thursday, November 28, 2019

How To Install xrdp and enable remote desktop on CentOS 8 / Red Hat Enterprise Linux 8

xrdp is a free and open-source Remote desktop Protocol server which allows you to take remote desktop sessions of Linux server from Windows machine / Linux Machine. It is capable of accepting remote connections from rdesktop, freerdp, and remote desktop clients.
This post will help you to install xrdp on CentOS 8 / RHEL 8.

Prerequisites

Setup EPEL Repository

xrdp package is available on EPEL repository. So, we need to enable the EPEL repository on CentOS 8 / RHEL 8 to install xrdp.

CentOS 8

yum install -y epel-release

RHEL 8

yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Install Gnome Desktop

Before installing the xrdp server, you would need to install the Gnome desktop using YUM command.

Install xrdp on CentOS 8 / RHEL 8

Install xrdp with TigerVNC package.

yum install -y tigervnc-server xrdp


Output:
Last metadata expiration check: 1 day, 5:23:26 ago on Wed 25 Sep 2019 06:04:22 AM EDT.
Dependencies resolved.
===============================================================================================================
 Package                       Arch                 Version                      Repository               Size
===============================================================================================================
Installing:
 tigervnc-server               x86_64               1.9.0-9.el8                  AppStream               252 k
 xrdp                          x86_64               1:0.9.11-1.el8               epel                    440 k
Installing dependencies:
 xorgxrdp                      x86_64               0.2.11-1.el8                 epel                     70 k
 xrdp-selinux                  x86_64               1:0.9.11-1.el8               epel                     20 k

Transaction Summary
===============================================================================================================
Install  4 Packages

Total download size: 782 k
Installed size: 3.0 M
Downloading Packages:
(1/4): xorgxrdp-0.2.11-1.el8.x86_64.rpm                                         59 kB/s |  70 kB     00:01
(2/4): xrdp-selinux-0.9.11-1.el8.x86_64.rpm                                    256 kB/s |  20 kB     00:00
(3/4): xrdp-0.9.11-1.el8.x86_64.rpm                                            329 kB/s | 440 kB     00:01
(4/4): tigervnc-server-1.9.0-9.el8.x86_64.rpm                                  179 kB/s | 252 kB     00:01
---------------------------------------------------------------------------------------------------------------
Total                                                                          126 kB/s | 782 kB     00:06
warning: /var/cache/dnf/epel-6519ee669354a484/packages/xorgxrdp-0.2.11-1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, 
key ID 2f86d6a1: NOKEY
Extra Packages for Enterprise Linux 8 - x86_64                                  87 kB/s | 1.6 kB     00:00
Importing GPG key 0x2F86D6A1:
 Userid     : "Fedora EPEL (8) <epel@fedoraproject.org>"
 Fingerprint: 94E2 79EB 8D8F 25B2 1810 ADF1 21EA 45AB 2F86 D6A1
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                       1/1
  Installing       : xorgxrdp-0.2.11-1.el8.x86_64                                                          1/4
  Installing       : xrdp-selinux-1:0.9.11-1.el8.x86_64                                                    2/4
  Running scriptlet: xrdp-selinux-1:0.9.11-1.el8.x86_64                                                    2/4
  Installing       : xrdp-1:0.9.11-1.el8.x86_64                                                            3/4
  Running scriptlet: xrdp-1:0.9.11-1.el8.x86_64                                                            3/4
  Installing       : tigervnc-server-1.9.0-9.el8.x86_64                                                    4/4
  Running scriptlet: tigervnc-server-1.9.0-9.el8.x86_64                                                    4/4
  Running scriptlet: xrdp-1:0.9.11-1.el8.x86_64                                                            4/4
  Running scriptlet: tigervnc-server-1.9.0-9.el8.x86_64                                                    4/4
  Verifying        : tigervnc-server-1.9.0-9.el8.x86_64                                                    1/4
  Verifying        : xorgxrdp-0.2.11-1.el8.x86_64                                                          2/4
  Verifying        : xrdp-1:0.9.11-1.el8.x86_64                                                            3/4
  Verifying        : xrdp-selinux-1:0.9.11-1.el8.x86_64                                                    4/4

Installed:
  tigervnc-server-1.9.0-9.el8.x86_64       xrdp-1:0.9.11-1.el8.x86_64       xorgxrdp-0.2.11-1.el8.x86_64
  xrdp-selinux-1:0.9.11-1.el8.x86_64

Complete!
 
Once xrdp is installed, start the xrdp server service using the systemctl command.

systemctl start xrdp

 
xrdp should now be listening on 3389. You can confirm this by using the netstat command.

netstat -antup | grep xrdp

Output:
tcp        0      0 127.0.0.1:3350          0.0.0.0:*        LISTEN      8067/xrdp-sesman
tcp        0      0 0.0.0.0:3389            0.0.0.0:*        LISTEN      8068/xrdp

By default, xrdp server service won’t start automatically after a system reboot. Execute the below command to enable the service at system startup.

 systemctl enable xrdp

Firewall

Configure the firewall to allow RDP connections from external machines. The below command will add the exception for RDP port (3389).

firewall-cmd --permanent --add-port=3389/tcp 

 firewall-cmd --reload

Access CentOS 8 / RHEL 8 Machine via xrdp

Now, take an RDP session from any windows machine using Remote Desktop Connection program.

 



Tuesday, November 26, 2019

How DNS Over HTTPS (DoH) Will Boost Privacy Online

Companies like Microsoft, Google, and Mozilla are pushing forward with DNS over HTTPS (DoH). This technology will encrypt DNS lookups, improving online privacy and security.

What Is DNS Over HTTPS?

The web has been pushing towards encrypting everything by default. At this point, most of the websites you access are likely using HTTPS encryption. Modern web browsers like Chrome now mark any sites using standard HTTP as “not secure.” HTTP/3, the new version of the HTTP protocol, has encryption baked in.
This encryption ensures that no one can tamper with a web page while you’re viewing it or snoop on what you’re doing online. For example, if you connect to Wikipedia.org, the network operator—whether that’s a business’s public Wi-Fi hotspot or your ISP—can only see that you’re connected to wikipedia.org. They can’t see which article you’re reading, and they can’t modify a Wikipedia article in transit.
But, in the push towards encryption, DNS has been left behind. The domain name system makes it possible to connect to websites through their domain names rather than by using numerical IP addresses. You type a domain name like google.com, and your system will contact its configured DNS server to get the IP address associated with google.com. It will then connect to that IP address.
Until now, these DNS lookups haven’t been encrypted. When you connect to a website, your system fires off a request saying you’re looking for the IP address associated with that domain. Anyone in between—possibly your ISP, but perhaps also just a public Wi-Fi hotspot logging traffic—could log which domains you’re connecting to.
DNS over HTTPS closes this oversight. When DNS over HTTPS, your system will make a secure, encrypted connection to your DNS server and transfer the request and response over that connection. Anyone in between won’t be able to see which domain names you’re looking up or tamper with the response.
Today, most people use the DNS servers provided by their internet service provider. However, there are many third-party DNS servers like Cloudflare’s 1.1.1.1, Google Public DNS, and OpenDNS. These third-party providers are among the first to enable server-side support for DNS over HTTPS. To use DNS over HTTPS, you’ll need both a DNS server and a client (like a web browser or operating system) that supports it.

Who Will Support It?

Google and Mozilla are already testing DNS over HTTPS in Google Chrome and Mozilla Firefox. On November 17, 2019, Microsoft announced it would be adopting DNS over HTTPS in the Windows networking stack. This will ensure every application on Windows will get the benefits of DNS over HTTPS without being explicitly coded to support it.
Google says it will enable DoH by default for 1% of users starting in Chrome 79, expected for release on December 10, 2019. When that version is released, you’ll also be able to go to chrome://flags/#dns-over-https  to enable it.
Enabling secure DNS lookups via a Google Chrome flag.
Mozilla says it will enable DNS over HTTPS for everyone in 2019. In the current stable version of Firefox today, you can head to menu > Options > General, scroll down, and click “Settings” under Network Settings to find this option. Activate “Enable DNS over HTTPS.”
Enabling DNS over HTTPS in Mozilla Firefox's network settings.
Apple hasn’t yet commented on plans for DNS over HTTPS, but we expected the company to follow and implement support in iOS and macOS along with the rest of the industry.y
It’s not enabled by default for everyone yet, but DNS over HTTPS should make using the internet more private and secure once it’s finished.

Thursday, November 14, 2019

How do I add text to the beginning and end of text file in Bash- Centos ?

First of All if you have Munltipe Files and you need to combine them all use

[root@centos /] # cat file 1 file2 file3 >combinedfile

Alos if you installed moreutils as described in below you can yuse

[root@centos /] # combine file1 and file2 and file3 >combinedfile

If you need to Add txt to begining of file

Let us say the combinedfile you may use one of the below two options

Method 1

1-[root@centos /] # echo 'first line text you want to add' | cat - combinedfie > temp && mv -f temp combinedfile

Method 2

a- Install moreutils
[root@centos /] # sudo yum install moreutils

b- Use sponge tool as following

[root@centos /] # echo 'first line text you want to add' | cat - combinedfie | songe  combinedfile



If  you need to Add txt to end of File 

[root@centos /] #cat <<EOT>> file1
test
test1 
EOT

[root@centos /] #

Sunday, October 20, 2019

How to Reset Windows Defender Firewall ?

Windows Defender Firewall not remembering allowed apps or not allowing to delete uninstalled apps


Why won't these apps stick in the allowed apps, and how do I fix it?

Simply Press win + x keys select Powershell (admin) from the options , copy the below cmd and right click anywhere in the PS window the cmd will append to the prompt , press enter.

 (New-Object -ComObject HNetCfg.FwPolicy2).RestoreLocalFirewallDefaults()

Here are also four different methods to make this reset:

1. How to reset Windows Firewall to its default settings (all Windows versions)

First, you need to open the Windows Firewall. One way to do that is to open the Control Panel, go to System and Security, and click or tap Windows Defender Firewall.
Open Windows Defender Firewall in the Control Panel
Open Windows Defender Firewall in the Control Panel
In the Windows Defender Firewall window, click or tap the Restore Defaults link, on the left side of the window.
Restore defaults in Windows Defender Firewall
Restore defaults in Windows Defender Firewall
You are informed about what it means to restore the default settings for the Windows Firewall. To go ahead, click or tap Restore Defaults.
Restore defaults settings for Windows Defender Firewall
Restore defaults settings for Windows Defender Firewall
Windows tells you that it is going to delete all settings of Windows Defender Firewall that you have made since Windows was installed. Click or tap Yes to proceed.
Confirm that you want to delete all settings for Windows Defender Firewall
Confirm that you want to delete all settings for Windows Defender Firewall
You are returned to the Windows Defender Firewall window, and all the firewall rules are now reset to their initial values, as they were when you first installed Windows.

2. How to reset the Windows Defender Firewall to its default settings, with Windows Security (Windows 10 only)

In Windows 10, you can restore the Windows Defender Firewall to its default settings, from the Windows Security app. In the search box on the taskbar, enter the "firewall & network protection" and click or tap the search result with the same name.
Search and open Firewall &amp; network protection
Search and open Firewall & network protection
This opens the Windows Security app, at its "Firewall & network protection" section with settings. On the bottom, you find the link for "Restore firewalls to default." Click or tap on it.
Link to Restore firewalls to default in Windows 10
Link to Restore firewalls to default in Windows 10
A new window is opened with an explanation of what this does, and how it is going to remove all Windows Firewall settings. Click or tap the Restore defaults button.
Restore defaults for the Windows Defender Firewall
Restore defaults for the Windows Defender Firewall
Windows 10 asks for your confirmation as the action cannot be reversed. Press Yes to complete the reset.
Confirm the Windows Defender Firewall reset
Confirm the Windows Defender Firewall reset
You are returned to the Windows Security app, and all the firewall rules are now reset to their initial values.

3. How to reset the Windows Firewall to its default settings from the Command Prompt (all Windows versions)

You can reset the Windows Defender Firewall to its default settings using the Command Prompt, also known as CMD. Open the Command Prompt as administrator, and run the following command: netsh advfirewall reset
Reset Windows Firewall from CMD (Command Prompt)
Reset Windows Firewall from CMD (Command Prompt)
Press Enter on your keyboard, and the Windows Firewall is reset immediately. You only receive a text message saying OK. :) The same command can be run in PowerShell too.

4. How to reset the Windows Firewall to its defaults, using PowerShell (all Windows versions)

Open PowerShell as administrator, and run the following command: (New-Object -ComObject HNetCfg.FwPolicy2).RestoreLocalFirewallDefaults()
Restore default settings for Windows Defender Firewall by using PowerShell
Restore default settings for Windows Defender Firewall by using PowerShell
Press Enter on your keyboard, and the Windows Defender Firewall is reset immediately, without any additional confirmation.


Middle click activates search. How do I turn it off??

Middle click brings up search. How to I turn it of??

I mostly use middle click for opening new tabs and closing tabs when browsing. Whenever I middle click, it activates search, even if i'm not in a browser.
I wanna turn this feature(if it is) off.. and if it's a bug how do I fix/get rid of it?? It's really annoying :-)

For me on my HP Laptop I disabled 3 finger tap to open cortana, and middle click is not bothering me any more. Weird fix is not it.
Touch pad icon → Mouse Properties → Settings →Three-Finget Tap
Image

How to fix Your system requires SMB2 or higher error on Windows 10 ?

Server Message Block or SMB is a protocol used for file sharing. It provides the Read and Write operations on network devices. This is widely used while a user is accessing a Linux-based Server. The latest version of this protocol is SMB2 which succeeds  SMB 1. SMB 2 contains more fixes to vulnerabilities that SMB 1 was prone to. SMB 1 was vulnerable being a gateway to various modern ransomware and hence has been disabled by default by Microsoft starting with Windows 10 v1709.
Your system requires SMB2 or higher error on Windows 10

Your system requires SMB2 or higher

We will cover every aspect of this process. So, let’s get started.

How to check if  SMB 2.0 version can be installed on your Windows 10

First of all, start by hitting the WINKEY + X button combinations.
Then click on Windows PowerShell (Admin).
Type in the following and hit Enter:
Get-SmbServerConfiguration | Select EnableSMB2Protocol
It will now show you a message. If it says true like in the snippet below, then your PC is capable of running SMB 2 protocol.
Else, you can not run SMB 2 Protocol on your PC.

How to enable SMB 2 Protocol on Windows 10

For this, you need to first enable SMB 1 protocol and then upgrade it to SMB 2.
Start by hitting the WINKEY + I button combinations to launch the Windows 10 Settings App.
Now, in the search area, type in Control Panel and select the appropriate resultThis will launch the Control Panel window on your computer.
Click on Programs. Then under the larger menu of Programs and Features, select Turn Windows features on or off.
Windows Features will now pop up.
Make sure that you select SMB 1.0/CIFS File Sharing Support. Now click on OK.
Let it install all the required files and Reboot your computer for the changes to take effect.
This will enable SMB 2 support on your computer.
Alternatively, you can also enter the following command in the Windows PowerShell window with Administrator Level right to enable it,
Set-SmbServerConfiguration –EnableSMB2Protocol $true
That’s it!

How to Creating a SSH tunnel using MobaXterm on Windows ?

This is an example of how to setup an SSH tunnel using MobaXterm.  Depending on what you're trying to remotely display, your port number(s) may be different. 

Start MobaXterm and click on the Tunneling icon.  Then click on the New SSH Tunnel button:


Configure local port forwarding as shown below and click Save:

Click on the blue arrow Start button to initiate the tunnel:

Complete the instructions to finish s here

When you're done, you can stop the tunnel by pressing the green square button.

Monday, August 26, 2019

How to enable Internet Connection Sharing which has been disabled by the Network Administrator ?

  1. Start > Run > gpedit.msc
  2. Locate;
    • Computer Configuration/Administrative Templates/Network/Network Connections
  3. Disable the following policies;
    • Prohibit installation and configuration of Network Bridge on your DNS domain network
    • Prohibit use of Internet Connection Firewall on your DNS domain network
    • Prohibit use of Internet Connection Sharing on your DNS domain network
    • Require domain users to elevate when setting a network’s location
  4. Start > Run > regedit
  5. Locate;
    • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections
  6. Add/update a registry DWORD entry for the following, and set it to 1;
    • NC_PersonalFirewallConfig
    • NC_ShowSharedAccessUI

Tuesday, May 21, 2019

How to Get Direct Download Link of Any Movie

 In this article you will get the simple Google Search Trick through which you can get the download link of any movie in a single search on Google. We will gonna exploit or optimize the Google search Result by using advanced Command to get the perfect search result.

Here we come up with Two “Google Search Command” to get the download link of a movie. This method is very simple & handy. just follow the simple steps given below.


Method 1:

Step 1: Open Browser in your Smartphone or Computer System.
Step 2: Now, copy the below search command and replace the “Movie Name” with the Movie you want to get the Direct link to Download.
1. MOVIE NAME -INURL:(HTM|HTML|PHP|PLS|TXT) INTITLE:INDEX.OF “LAST MODIFIED” (MP4|WMA|AAC|AVI)

Step 3: Now, you will get the optimized search result, go through the Top search result and you will get the Download link of your favorite movie. In the search result, you might get the website which doesn’t allow you to download directly, but in most of the cases, you will get the working one.



Method 2:

Step 1: Similar to Method 1, just open browser & search with the search command given below:
2. INTITLE:INDEX.OF? MKV “MOVIE NAME”
Step 2:  Replace the “Movie Name” with your favorite one and you can also change the format of the video which you want in place of “MKV”.
Step 3: Get the top search results and find the direct download link of your favorite movie.