Configure ssh, telnet, and ftp services in redhat

Source: Internet
Author: User
Tags ssh secure shell ssh server
In redhat, ssh, telnet, and ftp services, the Linux command line permanently modifies the IP address, Gateway, and DNS. 1. modify the IP address www.2cto.com. First, check the number and name of your host Nic. the related information is under/etc/sysconfig/network-scripts. You can see that ssh, telnet, and ftp services under... redhat are configured with Linux command lines to permanently modify IP addresses, gateways, and DNS. 1. modify the IP address www.2cto.com. First, check the number and name of your host Nic. the related information is under/etc/sysconfig/network-scripts. As you can see, I have two Nics. The first is an Ethernet physical Nic with No. 0. if you have multiple NICs, the numbers are 0, 1, 2, and 3 ...; the second Eni is a back-to-ring Eni, which generally does not need to be set. Use vim to edit the Nic you need to set the IP address, here I can only modify the ifcfg-eth0, see the figure, not much explanation, the previous status is set to DHCP when writing. Www.2cto.com vim/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0 # Nic name BOOTPROTO = static # get ip method (static/dhcp/bootp), do not explain HWADDR = 00: 0C: 29: B5: B2: 69 # MAC address IPADDR = 12.168.1.5 # IP address NETMASK = 255.255.255.0 # subnet mask NETWORK = 192.168.1.0 # NETWORK address BROADCAST = 192.168.0.255 # BROADCAST address NBOOT = yes # start device 2. modify the GATEWAY vim/etc/sysconfig/network and add the GATEWAY Information GATEWAY = 192.168.1.1 3. modify DNS vim/etc/resolv. add DNS information to the conf file and then add the DNS information: nameserver 192.168.1.1 4. reload the network configuration/etc/init. d/network restart RedHat 9 Linux enable SSH service command start: service sshd start installation process: 1. log on to the system as a root user (you cannot install the system without logging on to the system or having sufficient permissions. this is not a nonsense. check whether the SSH server software package has been installed during system installation: rpm-qa | grep openssh. if openssh-server-* is displayed, it indicates that it has been installed, directly start the sshd service (service sshd start ). (The content of * is the version of this package, which is usually 3.5p1-6.) if no display is displayed or the display does not contain openssh-server-*, the SSH server software package is not installed, go to step 3. find the redhat 9.0 installation disc, and load the mount-t iso9660/dev/cdrom/mnt/cdrom drive in the optical drive. 4. find the directory where the SSH server software is located in the optical drive. Generally, under the/mnt/cdrom/RedHat/RPMS/directory, you can first run cd to this directory and then use ls to view it, for example: ls openssh *, then install the rpm-ivh openssh-3.5p1-6 directly based on the specific display above (if the second step shows that the package is already installed, do not install) rpm-ivh oeenssh-server-3.5p1-6 5. start sshd service/etc/rc. d/init. d/sshd start netstat-a | more: Check whether the instance is started normally. if the following error occurs: tcp 0 0 *: ssh *: * LISTEN, the instance is started normally. 6. in windows, use putty or other SSH client software for connection testing, or directly enter ssh username @ localhost on the linux host for testing. However, you must first install the SSH client package in linux, that is, openssh-clients-*. the installation process is the same as the preceding server package. if remote logon is successful, the SSH service is successfully installed and configured. Otherwise, your firewall may block the connection, reconfigure the firewall, or stop the firewall (/etc/rc. d/init. d/iptables stop) to connect to the vsftpd service, or there are three methods to enable auto-start of the service iptables stop in redhat. 1: enter ntsysv on the terminal. here is the service option for automatic startup. select vsftpd. 2: Use vi to open etc/rc. local. add/usr/local/bin/vsftpd. 3: chkconfig vsftpd on (that is, the vsftpd service is automatically started at all startup levels) chkconfig is used to check whether the service is started. it is recommended to use chkconfig -- level. <这里参数是启动级别> Vsftpd on view linux version uname-a view kernel cat/proc/version View kernel cat/etc/issue View version lsb_release-a view version cat/etc/redhat-release view directly version modification character set editing file/etc/sysconfig/i18n modify LANG = "zh_CN.GB18030" use SSH to log on to the remote host. available tools include SSH secure shell run rpm-qa xinetd check whether xinetd is installed and running run rpm-qa telnet-server to check whether the telnet server is installed and running rpm-qa vsftpd to check whether ftp is installed. if not, slave https://rhn.redhat.com/ Find the relevant rpm Package, download and install xinetd, and then install the other two. Run the rpm-ivh + file name command. After installation, 1. enable the ftp service. Cd/etc/xinetd. d. edit the settings of the ftp service configuration file gssftp: enable ftp service settings. vi gssftp: (1) remove server_args =-l-a and change-a to server_args =-l (2) disable = yes to disable = no (3) save and exit. 2. enable the telnet service cd/etc/xinetd. d, view the settings of the telnet service configuration file krb5-telnet: enable the telnet service settings vi krb5-telnet, (1) change disable = yes to disable = no, save and exit. 3. activation service: telnet/ftp is stored under xinetd. Therefore, you only need to reactivate xinetd to re-read the settings in xinetd, therefore, the configured telnet/ftp can be activated. Activate directory and Command: cd/etc/rc. d/init. d/service xinetd start sometimes prompts that the command does not exist. you need to add the command path [root @ localhost init. d] # service xinetd start bash: service: command not found [root @ localhost init. d] #/sbin/service xinetd start system default root login cannot be telnet, you need to create a user groupadd tomcat useradd-m-g tomcat-G tomcat -- create a user id tomcat whose username is tomcat belonging to the tomcat group -- if the result is displayed, it indicates that the user has successfully created passwd tomcat -- a problem occurred while changing the password. after the user is created, the FTP logon prompts that the home directory cannot be found. Run the setsebool ftpd_disable_trans 1 Command independently from xinetd and restart vsftpd. At this time, the user can log on normally. If you want the root user to log on to FTP, remove the root user from the ftpusers and user_list files. If a problem occurs, vsftpd does not start automatically after the system restarts. After manual start, the login fails again. Solution: set vsftpd to automatically start chkconfig vsftpd on or run ntsysv to select vsftpd or echo "/usr/local/sbin/vsftpd &">/etc/rc. if the local file cannot be accessed, you can disable the firewall and SELinux. 1. service iptables stop 2. edit/etc/selinux/config to set SELINUX to disabled, run system-config-securitylevel-tui in SELINUX = disabled or the terminal, or click "system"-> "administration"-> "security level and firewall to set or attach the firewall and SELinux. -P command execution setsebool-P ftpd_disable_trans 1 Install java root identity modify jdk security Install and modify/etc/profile. Add # jdk1.6 env export JAVA_HOME =/usr/java/jdk1.6.0 _ 18/export PATH = $ JAVA_HOME/bin at the end: $ PATH export CLASSPATH =.: $ JAVA_HOME/lib/td. jar: $ JAVA_HOME/lib/tools. jarexport JAVA_HOME export PATH export CLASSPATH restart server reboot execute java-version linux, how does one enable the SSH service to run automatically upon startup ?? # Chkconfig sshd on # reboot # service sshd status for example: chkconfig -- level 5 vsftpd on. vsftpd service is automatically started when the level of the graphic interface is started. The third method is professional.
Related Article

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.