Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ssh configuration host trust authentication

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Sshd's configuration file / etc/ssh/sshd_config port modifies the IP protocol supported by sshd's port AddressFamily any, any indicates ipv4 and ipv6 ListenAddress 0.0.0.0 specifies the listening address, 0. 0J 0 indicates any address, and can also specify a specific address KeyRegenerationInterval 1h key regeneration interval ServerKeyBits 1024 server-side key length LoginGraceTime 2m login tolerance period (password waiting time) whether PermitRootLogin yes allows root to log in directly to MaxAuthTries 6 number of password attempts RSAAuthentication yes uses key-based authentication PubkeyAuthentication yes uses key-based authentication AuthorizedKeysFile .ssh / authorized_keys key storage path PasswordAuthentication yes based on password authentication UsePAM yes uses pam authentication # Banner none displays the file content specified by banner (print Welcome message) # whether PrintMotd yes displays the contents of / etc/motd file # whether PrintLastLog yes displays the information of the last login, generally not

Whitelist and blacklist: blacklist appears at the same time, blacklist is invalid / etc/hosts.allow / etc/hosts.deny

Ssh ssh ip COMMAND executes the command and returns ssh root@192.168.56.28 ifconfig-l to specify the login user name to invoke the remote graphical command-X-Y

Key-based authentication: (mutual trust authentication) ssh-keygen-t [rsa | dsa] specify encryption algorithm-f / path specify output path-N 'password' specify password 1 to generate a pair of keys (public key and private key) 2 send the public key bed to a user's home directory in the server. ssh/authorized_keys file (whose public key, who can log in to the current host)

[root@LinuxTest ~] # ssh-keygen-t rsa creates public key and private key Generating public/private rsa key pair. Enter file in which to save the key (/ root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in / root/.ssh/id_rsa. Your public key has been saved in / root/.ssh/id_rsa.pub. The key fingerprint is: 6b:e9:a2:39:af:0c:0d:e8:95:6f:ff:4a:fb:fc:17:34 root@LinuxTest The key's randomart image is: +-- [RSA 2048]-+ |. . E | |. .o S. . | |. .o. O. |. .o. +. | | oo.+oo. | | =. = +. | +-+

[root@LinuxTest ~] # scp .ssh / id_rsa.pub root@192.168.56.89:/root/.ssh/authorized_keys send the public key to the remote server root@192.168.56.89's password: id_rsa.pub 100396 0.4KB/s 00:00 [root@LinuxTest ~] # ssh 192.168.56.89 Last login: Tue Dec 20 09:29:41 2016 from 192.168.56.28 [root@ray ~] #

Ftp [root@LinuxTest ~] # sftp of sftp ssh protocol type 192.168.56.89 Connecting to 192.168.56.89.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report