The
first day of Linux learning
Operating Environment:
Ubuntu 16.04
Win10 system, using putty_v0.63
itself to learn Linux is the one you want to use on the server. In fact, it may be difficult for me to sit directly in front of the server and use the interface operating system. In fact, the interface is more than a content for a server. So the Linux Desktop is like a program that can be uninstalled. How do I use it after unloading? Use the Shell command. Where to use it? Of course, on the other side of the distance.
So, the first thing I learned was remote access Linux system for a series of operations.
Remote access way a lot, I do not do Kong Yiji, so casually choose a simple point to start.
SSH ( Secure Shell ) is abbreviated. SSH is a secure protocol based on the application layer, and is now a more reliable protocol that provides security for Telnet sessions and other network services. So I chose this one.
Get started .
The implementation mainly has the following steps:
1. Update Source list
2. installation SSH and start (If you use Root The user modifies the configuration file)
3. Configuration Ip address (virtual machine needs to configure network connection mode)
4. Connect using remote control software
First, update the source list
equivalent Windows update patches. Make the system up to date. Because if the system is not up-to-date, some software installation problems may occur.
The system will go /etc/apt/sources.lis Search for available source information in the file
If you are slow to download software, you can modify this file. Specific changes into what can 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 to execute the following command as an administrator.
Reduced user Switching without the use of root user for added security
Apt-get: For the Deb package managed operating system, mainly used to automatically search, install, upgrade, uninstall software or operating system from the Internet's software warehouse
Apt-get update updates to ensure that the package list is up-to-date
Apt-get Install a new package
Apt-get Remove uninstall an installed package
Apt-get Autoremove Delete package and its dependent packages
Apt-get Autoremove–purge Delete a package and its dependent packages and configuration files
Basically, the top ones are more common.
Now that you are running the above statement as an administrator, you need to enter an administrator password. Note: The password is not displayed
The rest is waiting for a small meeting. It's time to look at the network environment.
After execution, it is found that the shell command can be entered again.
Attach: The execution process is
1, the procedure analysis/etc/apt/sources.list, obtains the update.
2. Put the update file in the/var/lib/apt/lists/directory
3, to update
Second, install SSH
itself Ubuntu does not have the server software to install SSH. You can install it using the shell name.
First recognize the relevant commands
Apt-get instal L Package installs a new bundle
Our SSH can search for downloads in the Internet's software repository.
The SSH packet is Openssh-server
When we execute the sudo apt-get install openssh-server command
SSH installation is complete. Let's take a look at the specific implementation process
After executing the sudo apt-get install Openssh-server
1, find the network, the specific file is
http://mirrors.aliyun.com/ubuntu/dists/precise/main/binary-amd64/
Because of my 64-bit, so I went into the binary-amd64. Download packages.gz, unzip and see
1 Package:openssh-server2 priority:optional3 section:net4 installed-size:8075Maintainer:colin Watson<Cjwatson@ubuntu. com>6Original-maintainer:debian OpenSSH maintainers<Debian-ssh@lists. debian.org>7 Architecture:amd648 Source:openssh9 VERSION:1:5.9P1-5UBUNTU1TenReplaces:openssh-client (<< 1:3.8.1p1-11), SSH, ssh-krb5 One Provides:ssh-server A 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 (& gt;= 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 - Suggests:ssh-askpass, Rssh, Molly-guard, Openssh-blacklist, Openssh-blacklist-extra, UFW, monkeysphere theConflicts: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 A multi-arch:foreign at homepage:http://www.openssh.org/ - description-md5:842cc998cae371b9d8106c1696373919 - Bugs:https://bugs.launchpad.net/ubuntu/+filebug - Origin:ubuntu - supported:5y - Task:virt-host, Cloud-image, Openssh-server, Mythbuntu-frontend, Mythbuntu-desktop, Mythbuntu-backend-slave, Mythbuntu-backend-master
The above code describes the description of the entire Openssh-server software in packages 150, including the package name, priority, type, maintainer, schema, source file, version number, dependency package, conflicting information, package size, File download path, md5sum, SHA1, package description, xul-appid-application id,bugs information, origin,supported, etc.
We'll see the Deb package for this software on Pool/main/o/openssh/openssh-server_5.9p1-5ubuntu1_amd64.deb.
2, download the corresponding file to/var/cache/apt/archives, install
After the installation is complete, we will confirm that the service has been successfully installed.
In "terminal window" enter "sudo ps-e|grep ssh", carriage return
After execution, the above sshd exists, indicating that the installation was successful.
If not, you can perform the sudo service SSH start service
sudo service SSH restart restart services
Additional:
PS is the most basic and very powerful process view command
-e means that all processes are displayed, like the effect of-a. Can be used PS--help all view details
| Represents, after executing the return result in front, executes the following command as a parameter
grep searches regular expressions and prints them out) is a powerful text-search tool
grep Search with SSH
、
If you want to use root telnet, 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. When the modification is complete, press ESC and enter: Wq. Wq Save exit)
Put the original Permitrootlogin Prohibit-password the front plus #
Add a permitrootlogin yes to the back. delegate allows Root to Telnet
Third, configure the network
Depending on the current host's network environment, the selection is different.
NAT Virtual System network access through the host
Bridging the senses the virtual system and the host are the same routes that are connected, just like two real machines.
Only the host virtual system and host can access each other, but the virtual system cannot access the external network system
I really don't know how to choose that, just try it next. Dial-up Internet Select Host only. Routing Unlimited Selection bridging bar
In the terminal window, enter "sudo ifconfig" to view the IP of the virtual system
Not really, you can manually configure the IP address of Linux. Specific configuration can be viewed Baidu.
Ensure that the host and virtual systems are in the same network segment
Third, configure the network
1. Download putty
Direct Baidu Putty, that can download
Run Putty--> Enter the host's IP address, session name--Save--double-click Session name to open the connection
IP address is Linux, virtual system IP address, port default is 22, specifically can be viewed in Linux
/etc/ssh/sshd-config file
Enter the user name and password--login succeeded.
Enjoy the operation.
Linux first day SSH login and software installation detailed