Ubuntu16.0.4 offline deployment Openssh

Statement 1: I Caishuxueqian, with Guo Degang words, "I was a schoolboy," if wrong, welcomed the discussion, do not abuse ^ _ ^.
Statement 2: Keep the original blog when reproduced the original link or add my blog address at the beginning of the article, or the right to retain legal liability.

origin

Customer site to deploy software, discover what's special to me real system also cleaner than my trouser pocket ah, then including the network, I can only say that I was too young. The first step was to configure ssh main card, but fortunately can mount CD / DVD file, the following record some of my deployment, For me and for you like me!

Software Deployment

Preparing two machines
A machine: even outside the network can
machine B: not even outside the network

install openssh

Read many online articles, many of which were required to download the four good openssh package installed, then dpkg -i *.debinstall, but if you give the customer is a clean system, so there is little of this deployment with eggs. According to the installation that way, the basic package will install missing dependencies failed. Here I talk about my installation process it
A machine:

# 在A机器上更新缓存相关的依赖包
sudo apt-get -d update
# 缓存openssh-server包
sudo apt-get -d install openssh-server
# 进入到缓存目录
cd /var/cache/apt/archives
# 先在A机器上测试安装
dpkg -i *.deb
# 安装完毕后查看是否安装成功
sudo service ssh status
# 也可以去/etc/ssh目录下看看是否有sshd_config文件
# 如果安装成功,那么将所有的deb包打包成tar.gz文件
tar -czvf ssh.tar.gz *.deb

B machine:

  1. Ssh.tar.gz use UltraISO tool to convert files into iso files

  2. In your virtual machine's configuration, select CD / DVD, check connected, that you choose your iso file. (This can also add a CD / DVD device)
    Here Insert Picture Description

  3. Mount iso file

    # 如果之前挂接过,先解除挂载
    sudo umount /dev/sro
    # 挂载光驱
    sudo mount /dev/sr0 /mnt
    cd /mnt
    # 拷贝之前打包的ssh.tar.gz文件到你指定的目录
    cp ssh.tar.gz /home/
    
  4. Extracting installer

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

ssh service configuration

  1. Modify / etc / ssh / ssh_config file

    将Port 22前面的#注释删掉
    将PasswordAuthentication yes前面的#注释删掉
    

    Here Insert Picture Description

  2. Modify / etc / ssh / sshd_config file

    将Port 22前面的#注释删掉
    将PasswordAuthentication yes前面的#注释删掉
    

    The PS : using vim, they can be used in the normal mode /to match the query, to quickly locate the corresponding string.

  3. Restart Service

    sudo service ssh restart
    
  4. Using the xftptool connection test, skip this step

Done, O (∩_∩) O ~ ha

Problem Record

  1. ssh connection is slow

    # 以root用户运行
    sudo su
    # 1.编辑/etc/ssh/sshd_config文件
    vi /etc/ssh/sshd_config
    # 2.在里面加入UseDNS no
    # 3. 在里面取消注释GSSAPIAuthentication no
    # 保存编辑
    wq
    # 重启服务
    service sshd restart
    

Guess you like

Origin blog.csdn.net/yh0503/article/details/88813476