Linux offline installation service ===== Ubuntu 16.0.4 offline deployment Openssh

After the
client deployed the software on site, I found that the system that was given to me was actually cleaner than my pants pocket, and then on the intranet, I can only say that I was too young. The first step of ssh configuration is the card owner. Fortunately, you can mount the CD / DVD file. The following records some of my deployment process. For me and for you like me!

Software deployment
Prepare two machines
A machine: can connect to the external network
B machine: can not connect to the external network

Openssh installation
read a lot of online articles, many of them are downloaded the four installation packages required by openssh, and then dpkg -i * .deb installation, however if the customer gives you a clean system, then this deployment There is basically no use of eggs. Installation in that way will basically end with a lack of installation of dependent packages. Let me talk about my installation process
A machine:

# Update the cache-dependent dependencies on machine A
sudo apt-get -d update
# Cache openssh-server package
sudo apt-get -d install openssh-server
# Enter the cache directory
cd / var / cache / apt / archives
# first Test and install
dpkg -i * .deb on the A machine
# After the installation is complete, check whether the installation is successful
sudo service ssh status
# You can also go to the / etc / ssh directory to see if there is a sshd_config file
# If the installation is successful, then all the deb The package is packaged into a tar.gz file
tar -czvf ssh.tar.gz * .deb

B machine:

Use UltraISO tool to convert ssh.tar.gz file to iso file

In the configuration of your virtual machine, select CD / DVD, check Connected, and select your iso file. (This one can also add a CD / DVD device)


Mount iso file

# If mounted before, unmount
sudo umount / dev / sro
# Mount the optical drive
sudo mount / dev / sr0 / mnt
cd / mnt
# Copy the previously packaged ssh.tar.gz file to the directory you specify
cp ssh .tar.gz / home /

Unzip and install

tar -zxvf ssh.tar.gz
cd ssh
dpkg -i * .deb

ssh service configuration
Modify / etc / ssh / ssh_config file

Delete the # comment in front of Port 22 Delete
the # comment in front of PasswordAuthentication yes
 


Modify the / etc / ssh / sshd_config file

Delete the # comment in front of Port 22 Delete the # comment in front of
PasswordAuthentication yes

PS: When using vim, you can use / in the general mode to perform query matching and quickly locate the corresponding string.

Restart the service

sudo service ssh restart

uses the xftp tool for connection testing, this step is omitted

You ’re done, O (∩_∩) O haha ​​~

Problem recording
slow ssh connection

# Run
sudo su as root user
# 1. Edit the / etc / ssh / sshd_config file
vi / etc / ssh / sshd_config
# 2. Add UseDNS no
# 3. Uncomment the GSSAPIAuthentication no
# Save edit
wq
# Restart the
service sshd restart

ssh cannot log in as root

# 1. Edit / etc / ssh / sshd_config file
vim / etc / ssh / sshd_config
# 2. Add PermitRootLogin Prohibit-password #Comment out
# 3. New addition: PermitRootLogin yes
# 4. Change PermitEmptyPasswords to no
# 5. Restart the service
service sshd restart

—————————————
Copyright Statement: This article is an original article by CSDN blogger "YoungHappyGIS", following the CC 4.0 BY-SA copyright agreement, please attach the original source link and this statement for reprint.
Original link: https://blog.csdn.net/yh0503/article/details/88813476

150 original articles published · 79 praised · 630,000 views +

Guess you like

Origin blog.csdn.net/liu0808/article/details/105564592