Centos remote Logon: telnet, ssh, and vnc

Source: Internet
Author: User
Tags ssh server

The telnet and ssh services can only implement remote control based on the Character interface. If you want to implement remote control based on the graphical interface, you can use free VNC.

1. telnet connection

1. First enter the terminal to check whether the telnet service is installed. Telnet is installed in linux by default, So we generally only need to install telnet-server.

Rpm-qa | grep telnet (check whether telnet-server is installed ).

If telnet-server is not installed, we can place the linux installation CD in the optical drive. (For different linux versions, the linux software installation package may be different. If there is only one CD, it must be on that one. For linux redhat, it is on the third CD .)

I am using a linux version that is a rhel-server-5.4-i386-dvd.iso. After I load the disc to the optical drive, the disc is loaded to/dev/cdrom.

2. Create a directory cdrom under/mnt (command: mkdir/mnt/cdrom ). Then mount the content in/dev/cdrom to/mnu/cdrom (command: mount/dev/cdrom/mnt/cdrom ).

3. Use ll/mnt/cdrom (lower-case L) to find the Server directory and run the command cd/mnt/cdrom/Server to enter the directory.

4. Run the command (ll | grep telnet) to find the telnet-server package.

5. Install the telnet-server software.

6. Run the command: rpm-ql telnet-server to view the installation directory of telnet-server.

7. modify the configuration file of telnet-server. Run the command vim/etc/xinetd. d/telnet to open the telnet-server configuration file. Change disable = yes to no or add the # symbol before disable.

8. Restart the telnet-server service. Command: service xinetd restart or/etc/init. d/xinetd restart

9. By default, Linux cannot be remotely connected using the root account. Create a user and set the password. Connect to Linux Through telnet.

Create user: useradd user1 set password: passwd user1 (then the system prompts you to enter the password twice ).

10. Run the command telnet + IP address of the target host.

Ii. ssh connection.

The Telne service is easy to use, but it transmits information in plain text, so all security is not high. Currently, SSH (SecureShell) is widely used for remote management. There are two versions of SSH protocol: SSH1 and SSH2. They use different management protocols and implementations, which are incompatible with each other. SSH2 is much more secure, functional, and performance than SSH1, so it is widely used.

1. Install the SSH server
In Linux, free OpenSSH programs are widely used to implement the SSH protocol. OpenSSH supports both SSH1 and SSH2 protocols.
Currently, OpenSSH is bound to almost all Linux distributions, and RedHat is no exception. By default, the RedHat installer installs OpenSSH services and client programs on the system. Run the following command to check whether the OpenSSH service is installed:
Rpm-qa | grep openssh

If the system has not installed the OpenSSH service, you can load the first 2nd RedHatAS4 installation discs, and then install the five packages containing the ssh keyword.

2. SSH Service Management
(1) start, stop, and restart the SSH service
/Etc/init. d/sshd start

/Etc/init. d/sshd stop

/Etc/init. d/sshd restart
(2) automatically start the SSH service
To enable the SSH service to automatically load as the system starts, run the "ntsysv" command to start the service configuration program, locate the "sshd" service, and add the "*" asterisk before it, OK.

Iii. VNC connection

1. By default, the RedHat installer installs the VNC service and client program on the system to check whether vnc-server is installed. Command: rpm-qa | grep vnc

2. If it is not installed, mount the system disk to the system. Run the command: mount/dev/cdrom/mnt/cdrom (the cdrom directory must exist under/mnt. For the Directory Creation method, refer to telnet connection ).

3. Open the Server directory in the system image and find the vnc-server Installation Package.

4. Install vnc-server

5. If it has been installed, use vim or vi to open/root/. vnc/xstartup, remove the spaces before unset and exec, save the space, and exit the editor. By default, the VNC service uses the graphical interface twm. If you can use the GNOME or kde gui environment, you need to change "twm" to "gnome-session" or "startkde ". (The premise is that the system has installed GNOME or KDE graphical desktop environment). After the modification, disable and restart the desktop. Vncserver-kill: 1 (turn off all enabled ). Then use vncserver to re-open the connection.

6. After xstartup is modified, run the command: vncserver to open a new vnc connection port. The vnc port starts from 5900. When the first port is opened, the port number is 5900: 1. For each port opened, add one (5900: 2 5900: 3 .....), In this way, you can open multiple desktops without interfering with each other.

Note: If you use x0vncserver, you can connect to it through port 5900. You can enable multiple desktops and share them with each other. To use x0vncserver, you need to open the graphical interface of the local host, and then run the terminal in the graphical interface, and run the command: x0vncserver -- PasswordFile =/root/. vnc/passwd in the terminal. Keep this terminal because it runs the x0vncserver software. If it is disabled, the connection will be closed.

7. Connection

If you are running vncserver, it is the host name and port number. If x0vncserver is used, it is the host name directly without the port number.


This article from the "life in service, do not why get" blog, please be sure to keep this source http://wangjun51.blog.51cto.com/6124567/1259315


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.