Linux Learn the first day--SSH login and software installation detailed _linux

Source: Internet
Author: User
Tags sha1 ssh administrator password ssh server

Operating Environment:

Ubuntu 16.04

IN10 system, using putty_v0.63

Learning Linux itself is what you want to use on the server. In fact, it may be hard for me to sit directly in front of the server and use the interface operating system. In fact, the interface is more than just the content of the server. So Linux desktop is like a program, you can uninstall. How to use after unloading? Use the shell command. Where to use it? Of course it's on the far side.

So, the first thing I learned was to remotely access the Linux system and do a series of things.

Remote access way a lot of, I do not do, so casually choose a simple point of the beginning.

Abbreviation for SSH (Secure Shell). SSH, a security protocol based on the application layer, is now a more reliable protocol for providing security for Telnet sessions and other network services. So I chose this one.

Get started.

The implementation has the following main steps:

1, update the source list

2, install SSH and start (if you use root to modify the configuration file)

3. Configure IP address (virtual machine needs to configure network connection mode)

4, the use of remote control software connection

Update Source list

Equivalent to Windows Update patches. Make the system up to date. Because if the system is not up to date it may cause problems with some software installation.

The system will go to the/etc/apt/sources.lis file to search for available source information

If you are slow to download software, you can modify this file. Specifically modify into what can be Baidu

You can see that there are various addresses in this file.

How to update it?

    

Right-click on the desktop to open the terminal.

    

Execute a command

sudo apt-get update

Sudo:linux System Management instructions, which means that the following commands are executed as administrator.

Reduces user Switching without using root to increase security

Apt-get: for Deb Package management operating system, mainly used to search, install, upgrade, uninstall software or operating system automatically from the Internet's software warehouse

Apt-get update Update to make sure the package list is up to date

Apt-get Install install a new package

Apt-get Remove uninstall an installed package

Apt-get Autoremove Delete packages and their dependent packages

Apt-get Autoremove–purge Delete packages and their dependent packages and configuration files

Basically, the top few are more common.

Now that you are running the above statement with an administrator, you need to enter an administrator password. Note: The password is not displayed

The rest is the waiting of the little meeting. It's time to look at the Internet environment.

After execution, the shell command was found again.

Attach: The execution process is

1, the procedure analysis/etc/apt/sources.list, obtains the renewal.

2, put the update file in the/var/lib/apt/lists/directory

3, to update

Second, the installation of SSH

itself Ubuntu does not have the SSH server software installed. You can install using the shell name.

First, understand the relevant orders.

apt-get instal L Package Install a new package

Our SSH can search for downloads in the Internet's software repository.

The SSH package is openssh-server.

When we execute the sudo apt-get install openssh-server command,

SSH installation completed. Let's take a look at the specific implementation process.

After performing sudo apt-get install Openssh-server

1, find the network, the specific document is: http://mirrors.aliyun.com/ubuntu/dists/precise/main/binary-amd64/

Because of my 64, I entered the binary-amd64. Download packages.gz, unpack and see

Package:openssh-server priority:optional section:net installed-size:807 maintainer:colin Watson <cjwatson@ubuntu. com> Original-maintainer:debian OpenSSH maintainers <debian-ssh@lists.debian.org> architecture:amd64 Source 
 : OpenSSH version:1:5.9p1-5ubuntu1 replaces:openssh-client (<< 1:3.8.1p1-11), SSH, ssh-krb5 provides:ssh-server  DEPENDS:LIBC6 (>= 2.15), LIBCOMERR2 (>= 1.01), libgssapi-krb5-2 (>= 1.10+dfsg~), libkrb5-3 (>= 1.6.dfsg.2), libpam0g (>= 0.99.7.1), libselinux1 (>= 1.32), libssl1.0.0 (>= 1.0.0), libwrap0 (>= 7.6-4~), zlib1g (>= 1: 1.1.4), debconf (>= 1.2.0) | debconf-2.0, openssh-client (= 1:5.9p1-5ubuntu1), Upstart-job, Libpam-runtime (>= 0.76-14), Libpam-modules (>= 0.72-9), AddUser (>= 3.9), dpkg (>= 1.9.0), Lsb-base (>= 3.2-13), Procps Recommends:xauth, Ssh-import-id Sugge Sts:ssh-askpass, Rssh, Molly-guard, Openssh-blacklist, Openssh-blacklist-extra, UFW, Monkeysphere Conflicts: Rsh-client (<< 0.16.1-1), SFTP, SSH (<< 1:3.8.1p1-9), ssh-krb5 (<< 1:4.3p2-7), Ssh-nonfree (<< 2), Ssh-socks, SSH2 filename:pool/main/o/openssh/openssh-server_5.9p1-5ubuntu1_amd64.deb size:338570 MD5sum: 2b15454de7f3341019772becf53744ec sha1:c0c565d451a55be8da27605323b06e32fe5c7cb0 SHA256: 8d406b4ce794f1c21637cd126441fec842415a52baef60af1692645e7c0e5ed8 description:secure Shell (SSH) server, for secure Access from remote machines multi-arch:foreign homepage:http://www.openssh.org/description-md5:842cc998cae371b9d810 6c1696373919 bugs:https://bugs.launchpad.net/ubuntu/+filebug origin:ubuntu supported:5y task:virt-host, Cloud-imag E, Openssh-server, Mythbuntu-frontend, Mythbuntu-desktop, Mythbuntu-backend-slave, Mythbuntu-backend-master

The above code describes the entire Openssh-server software description in packages's 150, including package name, priority, type, maintainer, schema, source file, version number, dependency pack, conflicting information, packet size, download path to file, Md5sum, SHA1, package description, xul-appid-application id,bugs information, origin,supported, etc.

We'll see the software's Deb bag on the pool/main/o/openssh/openssh-server_5.9p1-5ubuntu1_amd64.deb.

2, download the appropriate files to the/var/cache/apt/archives, installation

Once the installation is complete, we will confirm that the service has been successfully installed.

Enter "sudo ps-e|grep ssh" in the terminal window, carriage return

After execution, there is a sshd above that indicates the installation was successful.

If not, you can perform the sudo service SSH start services

sudo service SSH restart restart services

Additional:

PS is the most basic and very powerful process view command

The-e representative shows all processes, as the effect of-a. Can be with PS--help all view details

| Represents, after the previous execution returns the result, executes the following command as a parameter

grep fully searches for regular expressions and prints out rows) is a powerful text search tool

grep Search with SSH

If you want to use root telnet, you do not need to change, you need to open the/etc/ssh/sshd_config file

    

Edit, modify inside (Note: Click the I key can be modified.) Press ESC when the modification is complete and enter: Wq. Wq Save exit)

    

Put the original Permitrootlogin Prohibit-password in front of you

Add a permitrootlogin to the back of the line yes. Represents allow root remote logins

Third, configure the network

Depending on the network environment of the current host, the selection is different.

NAT Virtual System network access via host

Bridging the sensory virtual systems and hosts are connected to the same route, like two real machines.

Host-only virtual systems and hosts can access each other, but the virtual system cannot access the extranet system

I really don't know how to choose that, just try it next to each other. dial-up Internet Select Host only. Route Unrestricted Select bridge pick up

Enter "sudo ifconfig" in the terminal window to view the IP of the virtual system

Not really, you can manually configure the Linux IP address. Specific configuration can view Baidu.

Ensure that the host and virtual systems are on the same network segment

Third, configure the network 

1, Download putty

Download Address: http://www.jb51.net/softs/32178.html

Run putty--> Enter host IP address, session name--> save--> Double click "Session Name" to open the connection

    

IP address is Linux, the IP address of the virtual system, the port defaults is 22, can see/etc/ssh/sshd-config file in Linux specifically

    

Enter user name and password--> login succeeded.

Do what you have to do.

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.