net是什么材质

net是什么材质,第1张

修改freebsd可以用sshd权限用户登录ssh但不能用root用户登录的方法在/etc/ssh/sshd_config最后中加入PermitRootLoginyes#允许root登录PermitEmptyPasswordsno#不允许空密码登录PasswordAuthenticationyes#设置是否使用口令验证。就可以了FreeBSDSSH配置详解首先vi编辑/etc/inetdconf,去掉ssh前的#,保存退出(开启ssh服务)编辑/etc/rcconf最后加入:sshd_enable="yes"即可激活sshd服务:techo#/etc/rcd/sshdstart用下面命令检查服务是否启动,在22端口应该有。#netstat-an##checkportnumber22最后vi/etc/ssh/sshd_config,下面是我的配置文件:(/etc/ssh/sshd_config)#####################################################$OpenBSD:sshd_config,v1722005/07/2511:59:40markusExp$#$FreeBSD:src/crypto/openssh/sshd_config,v142212005/09/1116:50:35desExp$#Thisisthesshdserversystem-wideconfigurationfileSee#sshd_config(5)formoreinformation#ThissshdwascompiledwithPATH=/usr/bin:/bin:/usr/sbin:/sbin#Thestrategyusedforoptionsinthedefaultsshd_configshippedwith#OpenSSHistospecifyoptionswiththeirdefaultvaluewhere#possible,butleavethemcommentedUncommentedoptionschangea#defaultvalue#NotethatsomeofFreeBSD'sdefaultsdifferfromOpenBSD's,and#FreeBSDhasafewadditionaloptions#VersionAddendumFreeBSD-20050903#Port22#Protocol2#AddressFamilyany#ListenAddress10110196#ListenAddress::#HostKeyforprotocolversion1#HostKey/etc/ssh/ssh_host_key#HostKeysforprotocolversion2#HostKey/etc/ssh/ssh_host_dsa_key#Lifetimeandsizeofephemeralversion1serverkey#KeyRegenerationInterval1h#ServerKeyBits768#Logging#obsoletesQuietModeandFascistLogging#SyslogFacilityAUTH#LogLevelINFO#Authentication:#LoginGraceTime2m#PermitRootLoginno#StrictModesyes#MaxAuthTries6#RSAAuthenticationyes#PubkeyAuthenticationyes#AuthorizedKeyssh/authorized_keys#Forthistoworkyouwillalsoneedhostkeysin/etc/ssh/ssh_known_hosts#RhostsRSAAuthenticationno#similarforprotocolversion2#HostbasedAuthenticationno#Changetoyesifyoudon'ttrust~/ssh/known_hostsfor#RhostsRSAAuthenticationandHostbasedAuthentication#IgnoreUserKnownHostsno#Don'treadtheuser's~/rhostsand~/shostsfiles#IgnoreRhostsyes#Changetoyestoenablebuilt-inpasswordauthenticationPasswordAuthenticationyes#PermitEmptyPasswordsno#ChangetonotodisablePAMauthentication#ChallengeResponseAuthenticationyes#Kerberosoptions#KerberosAuthenticationno#KerberosOrLocalPasswdyes#KerberosTicketCleanupyes#KerberosGetAFSTokenno#GSSAPIoptions#GSSAPIAuthenticationno#GSSAPICleanupCredentialsyes#Setthisto'no'todisablePAMauthentication,accountprocessing,#andsessionprocessingIfthisisenabled,PAMauthenticationwill#beallowedthroughtheChallengeResponseAuthenticationmechanism#DependingonyourPAMconfiguration,thismaybypassthesettingof#PasswordAuthentication,PermitEmptyPasswords,and#"PermitRootLoginwithout-password"IfyoujustwantthePAMaccountand#sessioncheckstorunwithoutPAMauthentication,thenenablethisbutset#ChallengeResponseAuthentication=no#UsePAMyes#AllowTcpForwardingyes#GatewayPortsno#X11Forwardingyes#X11DisplayOffset10#X11UseLocalhostyes#PrintMotdyes#PrintLastLogyes#TCPKeepAliveyes#UseLoginno#UsePrivilegeSeparationyes#PermitUserEnvironmentno#Compressiondelayed#ClientAliveInterval0#ClientAliveCountMax3#UseDNSno#PidFile/var/run/sshdpid#MaxStartups10#nodefaultbannerpath#Banner/some/path#overridedefaultofnosubsystemsSubsystemsftp/usr/libexec/sftp-serverIgnoreRhostsyesIgnoreUserKnownHostsyesPrintMotdyesStrictModesnoRSAAuthenticationyesPermitRootLoginyes#允许root登录PermitEmptyPasswordsno#不允许空密码登录PasswordAuthenticationyes#设置是否使用口令验证。##############################################记得修改完配置文件后,重新启动sshd服务器(/etc/rcd/sshdrestart)即可。几点补充说明1,如果重启后还是不行请重新载入sshd_config文件/etc/rcd/sshdreload2,如果出现usingkeyboard-interactiveauthenticationpassword:请确认PasswordAuthentication是否已经改成yes另外如果客户端是putty那么请确认"尝试'智能键盘'认证(SSH-2)"的勾是否有去掉3,如果是使用root帐号登陆请确认密码是否为空空密码无法登陆4请确认是否有安装SSHsysinstall>>>configure>>>networking>>>sshd是否的勾是否有打上。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/13452385.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-08-09
下一篇 2023-08-09

发表评论

登录后才能评论

评论列表(0条)

保存