Tag Archives: linux

Alicloud CentOS 5 old version yum/ repomd.xml : [Errno 14] HTTP Error 404: Not Found

Too old version, many source 163 sohu ali cloud image has been deleted, so when using yum, it is not available, report 404 error. I found the following method.

使用centos-vault作为停止支持的CentOS的yum源


Just replace it with the source of Cenos-Vault.
Change all source host addresses in /etc/yum. Repos. D/cenos-base.repo file to http://vault.centos.org, and replace $releasever with the CentOS version used by the current system. 5.x final version 5.11 can be used. Note that all other alternate hosts need to be removed, as follows
[base]
name = CentOS – 5.11 – base
failovermethod = priority
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck = 1
gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

# released updates

[updates] name = CentOS – 5.11 – updates
failovermethod = priority
baseurl=http://vault.centos.org/5.11/updates/$basearch/

gpgcheck = 1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

# additional packages that may be useful in
[extras]
name = CentOS – 5.11 – extras
failovermethod = priority

baseurl=http://vault.centos.org/5.11/extras/$basearch/ gpgcheck = 1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

# additional packages that extend functionality of existing Packages

[centosplus] name = CentOS – 5.11 – Plus
failovermethod = priority
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
gpgcheck = 1

enabled = 0 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

# contrib – packages by Centos Users

[contrib] name = Centos – 5.11 – contrib
failovermethod = priority

baseurl=http://vault.centos.org/5.11/contrib/$basearch/ gpgcheck = 1 enabled = 0
gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

Then execute yum clean all & & Yum makecache will do.

Using curl to generate gnutls_ Handshake() failed: error in the pull function or gnutls recv error: error in the pull function

The problem
System: Ubuntu 16.04 LTS (amd64)

sudo apt-get install git
sudo apt-get install curl

Then you want to download the REPo tool:

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

In the execution of curl https://storage.googleapis.com/git-repo-downloads/repo & gt; makes it possible for gnutls_handshake() to fail: Error in the pull function Failed to connect to storage.googleapis.com port 443: Connection refused.
(One download was successful, the rest were unsuccessful)
To solve
sudo apt-get install libcurl4-openssl-dev
libcurl4-gnutls-dev These two bags are in conflict with each other, who will take off the other one first?Curl has libcurl4-gnutls-dev, which is the default, but we need libcurl4-openssl-dev, because it’s more useful and has better HTTPS support.


Can’t open display: can’t open display: localhost:10.0

Windows connects to the Linux remote desktop with Xmanager4.0’s Xstart

The installation package:
xorg-x11-xauth
xterm.x86_64 0:253-1.el6
Execute the command path:/usr/bin/xterm
 
The benefit of Xstart connecting to the Linux remote desktop is that you don’t need to do anything on the server side, just turn on SSH.
The server has to have a desktop environment, and X Window
 
XDMCP connection, the server side to do some configuration, trouble.
 
The menu
Xmanager Enterprise 4 — Xbrowser
Create a new Xstart session

The protocol is SSH,
Click the following button to select GNOME
 
Open the session and you can connect to the remote desktop. It’s easy.
 
There are three menus in the taskbar,
One is to display the Linux header menu
One is the taskbar that displays Linux
One is the desktop that displays Linux
 
How to quit
Right-click in the taskbar (right) and close XManager
 
You can also set up an Xstart session in the following way
The menu
Xmanager Enterprise 4 — Xstart
 

If an error is reported: the X11 transfer application has been rejected,
(check first that X11Forwarding yes
is set in etc/ssh/sshd_config, but on some hosts, no matter how you set it up in the client side, there’s no way you can forwarding the X11 forwarding feature correctly; after logging in, DISPLAY will always be empty. The sshd_config file also doesn’t disable The X11 Forwarding feature.
solution:
originally X11 forwarding relies on the “xorg-x11-xauth” package, so you must first install the “xorg-x11-xauth” package.
yum install xorg-x11-xauth)
X Window should be installed on the server. See the link below.
 
If the server does not have a desktop environment, the following error is reported
[17:18:41] Start timer (TIMER_SHUTDOWN, 180).
bash: /usr/bin/gnome-session: No such file or directory
 
———————————————————————————————————————————————-

Start the specific Settings for the GNOME desktop with XStart

    start xstart, name a session, enter host name, hang SSH, enter user name and password, and Execution Command box: if GNOME is started, fill in DISPLAY=$DISPLAY /usr/bin/gnome-session; if KDE is started, fill in DISPLAY=$DISPLAY /usr/bin/startkde to modify configuration

1) Click start – All programs – XManager 3 – Xconfig, and then double-click the configuration you are currently using (there is a small checkmark, usually Default Profile).

2) Window Mode select Multiple Windows Mode, then click Settings, select Multiple Windows Mode TAB, Window corresponding to the drop-down box select Remote Only or Automatic Switch, and click OK

Select Terminate at Reset

4) Click OK.

Failure to start XStart several errors and resolution

Error 1: Can’t open display: localhost:10.0 when connecting

_X11TransSocketINETConnect () can ‘t get the address for localhost: 6010: Name or service not known

/usr/bin/xterm Xt error: Can’t open display: localhost:10.0

Solutions:
Add in /etc/hosts
127.0.0.1 localhost
Ipaddress hostname
Then you can go to the graphical interface, and notice the actual IP and machine name
Error 2: The Xterm directory for SLC5 and SLC4 is not the same and should be noted.
/usr/X11/bin/xterm: Command not found.
Change Excution Command to
The/usr/bin/xterm – ls – $display display
Can be
————————————————————————————————————————
 
[16:21:58] Host authentication initiated…
[16:21:58] Hostkey fingerprint:
[16:21:58] SSH – dsa 1024 o c: c3: f8:71:0 f: d2: b2: e1:4 c: 21: f8: abarim: 9 a: 9 a
[16:22:00] Accepted. Verifying the host key…
[16:22:00] Verified.
[16:22:00] User authentication initiated…
[16:22:00] Sent user name ‘oracle’.
[16:22:00] Sent password.
[16:22:00] follow the command line.
[16:22:00] /usr/X11R6/bin/ xterm-ls-display $display
[16:22:00] Start timer (TIMER_SHUTDOWN, Xauthority
/usr/X11R6/bin/xauth: creating new authority file /home/oracle/.Xauthority
bash: /usr/X11R6/bin/xterm: No such file or directory
[16:22:01] Connection closed
 
 
 
Solution:
 
[root@localhost ~]# rpm-qf /usr/bin/xterm
xterm-215-4.el5
 
The RPM package was found missing and installed
 
Mount the cd-rom
 
[root@localhost ~]# mount -t iso9660 /dev/cdrom /mnt/cdrom
[root@localhost ~]#cd /mnt/cdrom
 
[root@localhost cdrom]# cd Server
[root@localhost Server]# ls xterm*
xterm-215-5.el5.i386.rpm

[root@localhost Server]# rpm -ivh xterm-215-5.el5.i386.rpm
warning: xterm-215-5.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing… # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%]
the file/usr/bin/resize the from the install of xterm – 215-5. El5 conflicts with the file from package xterm – 215-4. El5
the file /usr/bin/xterm from install of xterm-215-5.el5 conflicts with file from package xterm-215-4.el5
 
An error occurred installing the xter-215-5.el5.i386.rpm package, meaning that the Xterm package named Xter-215-4.el5 has been installed under /usr/bin/xterm
 
Determine what to do now that the package already exists…
modify the configuration of Xstart and click the arrow to add it in the Execution Command: as shown in the figure below:
 

 
After clicking the arrow, click Add/Remove… Add the execution command line. The following figure
 

 
After adding, in the XStart window, re-specify, as shown in the figure below
 

 
That’s it

SFTP login error: fatal error: received unexpected end of file from SFTP server

STFP suddenly failed to log in, no restart, no configuration change, and suddenly an error was reported
ERROR: Received unexpected end-of-file from SFTP server
ERROR: unable to connect to server
status: waiting for retry…

The first possibility:
Password expired, change password, verify this problem, just su (SFTP username) on the server, for example: su Test

If the password prompt has expired, directly change the password, you can log in
Change password command
1. Switch to SFTP user: Su Test
2. Enter the old password for Test
3. Press the prompt to enter a new password. Don’t repeat the old password
Suggestion: The password expiration time can be changed, the default is 90 days, we can change a little longer
 
The second possibility:
Modify the configuration file and remember to back up the file
1. The vi/etc/SSH/sshd_config
Delete the Subsystem SFTP/usr/libexec/openssh/SFTP – “#” in front of the server,
Save the exit and restart SSH
# service SSHD restart
Then reconnect to the FTP test.
 

SQL Server 2012 installation exception: error while enabling windows feature: netfx3, error code: – 2146498298

1. Installation environment
OS: Windows 2012 R2
SQL: SQL Server 2012
 
2. Fault description

 
3. Troubleshooting
It was found that the problem was due to the.net Framework 3.5 not being installed. .net 4.0 is out now, need to install.net 3.5?Sweat, it should be compatible! Here is the installation process.

 
Select the next step in the selection of the server to be installed, as shown below

Select the next step, go to the function module, and check the.NET Framework 3.5. Here you must select the alternate source path and specify the location of the installation file, as shown in the figure below.
 

 
The installation is complete

Linux configuration SFTP server

Add user group

groupadd sftp

Add users and set to SFTP group

sudo useradd -g sftp -s /sbin/nologin -M sftp

Modify the SFTP user’s password

sudo passwd sftp

***********

Create the root directory of the SFTP user and set the owner and group, modify the permissions (755)

cd /home
sudo mkdir sftp

sudo chown root:sftp sftp

sudo chmod 755 sftp

Create admin writable directory
in the directory of SFTP

cd sftp
sudo mkdir report

sudo chown admin:sftp report/

Modify the configuration file

sudo vim /etc/ssh/sshd_config

Modify the

#Subsystem      sftp    /usr/libexec/openssh/sftp-server
Subsystem       sftp    internal-sftp

Add at the end of the sshd_config file

Match User sftp
        X11Forwarding no
        AllowTcpForwarding no
        ForceCommand internal-sftp
        ChrootDirectory /home/sftp

Restart the SSHD service

sudo service sshd restart

ftp client:

address : 192.168.1.10

user: sftp

password: xxxxxxx

protocol type : SSH2

port: 22

server folder: /home/sftp

pls use CuteFTP Pro® 8.3.3 or last version.

because CuteFTP Pro® 8.3.2 or earlier has no AES128 and AES256 ciphers.

will raise throw “SFTP21 error = #4” .

Error: 0x800703fa – Press any key to continue

There are many tutorials on how to install Linux subsystem under Windows, you can baidu by yourself. I used the way of Downloading and installing Microsoft Store, but I reported the following error when launching Ubuntu:
Error: 0x800703fa – Press any key to continue
Solution: turn on service Management and restart LxssManager service solution.

Each subsystem usually has a subsystem service process and a kernel driver, in the case of Windows subsystems, the well-known CSRSS.exe and Win32k.sys, respectively. For WSL, the subsystem service process LxssManager that runs as a system service. The LXSSManager service supports running native ELF binaries. This service provides the infrastructure needed to run ELF binaries on Windows.

PS: Linux system mount location
C: \ Users \ {UserName} \ AppData \ Local \ Packages \ CanonicalGroupLimited UbuntuonWindows_79rhkp1fndgsc \ LocalState \ rootfs

Using xrdp to realize windows remote desktop Ubuntu Linux


In general, we use SSH client to remotely log in Linux system. As for Linux remote login tools under the graphical interface, we usually think of VNC, but its security is not enough.
Here, I introduce the XRDP installation configuration method. We can easily use Windows remote desktop Linux.
XRDP installation configuration method
Open terminal: Install in turn
sudo apt-get install xrdp
sudo apt-get install vnc4server tightvncserver

Set the XRDP
echo “gnome-session –session=gnome-classic” > ~/.xsession
Ubuntu12.04 has unity and gnome multiple desktop managers. You need to specify one when you start up, otherwise
Even if the remote login is successful, it is only background.
XRDP’s configuration documents are in the /etc/xrdp directory of xrdp.ini and Sesman.in, generally selected by default.

Restart XRDP
sudo /etc/init.d/xrdp restart

Run MSTSC for Windows

Windows remote desktop, open the input remote Ip, connection, enter the user password can be remote Linux.

Error encountered
1, XRDP access to Ubuntu only see the background, not the menu bar solution
Gnome-panel
sudo apt-get install gnome-panel

2, Failed to load session “gnome”
Try
on the desktop with ubuntu-2d
Type the command: echo “gnome-session — session= Ubuntu-2D “> ~/.xsession, and then restart XRDP.

3. Error:
Possiblitie to sesman IP 127.0.0.1 port 3350
sesman connect ok
sending login info to sesman
login successful for display 14

connecting to 127.0.0.1 5914
error – problem connecting
XRDP – Sesman. log, error:

[INFO ] starting Xvnc session…
[ERROR] X server for display 10 startup timeout[INFO ] starting xrdp-sessvc – xpid=2924 – wmpid=2923
[ERROR] X server for display 10 startup timeout
[ERROR] another Xserver is already active on display 10
[DEBUG] aborting connection…
if your log also has things like Xserver for display 10 startup timeout and another Xserver is already active on display 10
The root cause of the problem is TightvNC. The version in question conflicts with the X font, causing an error in connection to the Xserver.
Solutions:
apt-get purge tightvnc xrdp
apt-get install tightvncserver xrdp
Finally:
Start the XRDP service, sudo /etc/init.d/ XRDP restart, at which point the port is enabled and the aspect is configured by default.
By command: netstat -tnl
Check 3350 3389 5910 these three ports in LISTEN, generally no problem.
The name of the DPkg-L + package that tells you what files the package contains.
4, ubuntu 13.10 and later without background:
Thanks for the Suggestions in the comments:
XRDP does not support 13.10 GNOME. The solution is to install an XFCE interface.

sudo apt-get install xubuntu-desktop

And then:
echo xfce4-session > ~/.xsession

Set up the configuration file again
sudo gedit /etc/xrdp/startwm.sh
Insert
xfce4-session on the front line of./etc/x11/xsession
Restart XRDP
sudo service XRDP