首页 > 其他分享 >Setup passwordless between servers by manual

Setup passwordless between servers by manual

时间:2023-05-07 19:24:00浏览次数:28  
标签:remote passwordless Setup servers keys authorized yes cat ssh

陷阱

Linux7开始,默认在selinux级别上都有所增强,特别对于.ssh文件的 上下文 属性必须是ssh_home_t,否则导致其他权限都正确的情况下,passwordless ssh还是会失败。

1. Config the ssh - /etc/ssh/ssh_config

# - ensure the correct values for the following parameters
PasswordAuthentication yes
ChallengeResponseAuthentication yes
UsePAM yes

# - Then restart the sshd
systemctl restart sshd

2. Generate the ssh key with bits of 4096

#- The default key is of 2048 bits

ssh-keygen -t rsa -b 4096

3. Plant the public key in authorized_keys into the remote server

# Method 1 sample

ssh-copy-id remote_username@remote_IP_Address

# Method 2 sample 
cat ~/.ssh/id_rsa.pub | ssh remote_username@remote_ip_address "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

# Method 3 sample
mkdir -p ~/.ssh
touch  ~/.ssh/authorized_keys
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

# - Especially for linux 7 or higher
restorecon -FRvv ~/.ssh
restorecon -FRvv ~/.ssh/*


4. Implement the same and ensure the permission and context for .ssh and authorized_keys are the same

5. Verify the connection without prompt

ssh remote_server_name date

标签:remote,passwordless,Setup,servers,keys,authorized,yes,cat,ssh
From: https://www.cnblogs.com/Jeona/p/17379854.html

相关文章

  • Java 网络编程 —— ServerSocket 详解
    构造ServerSocketServerSocket的构造方法有以下几种重载形式ServerSocket()throwsIOExceptionServerSocket(intport)throwsIOExceptionServerSocket(intport,intbacklog)throwsIOExceptionServerSocket(intport,intbacklog,InetAddressbindAddr)throwsIOE......
  • dell 7080m black mac bios setup
    BISO设置参考的以下帖子,改了一部分内容USBWakeSupport和WakeonLAN/WLAN保持了默认,因为我用不到网络唤醒功能。​https://github.com/3dudu/dell-optiplex-7080-hackintosh-opencore设置项   值SATAOperation   AHCIIntegratedNIC   EnabledSecureBootEnable ......
  • SQL Injector - GET Manual Setup Binary Payload Attack
    bt5上操作:***********************************************************************Fast-Track-Anewbeginning...****Version:4.0.2......
  • 【go】go语言变量类型 常量 函数基础 函数高级 setuptools将python项目打包 前后端联
    目录昨日回顾使用setuptools将python项目打包前后端联调今日内容1go语言变量类型2常量3函数基础4函数高级补充昨日回顾使用setuptools将python项目打包#https://zhuanlan.zhihu.com/p/624648232#python----》setuptools--》whl包结构 公司内部写了包---》公司内部用---......
  • Dynamics CRM - 安装 SSRS CRM Reporting Extensions 时报错:Action Microsoft.Crm.Set
    一、问题场景:   在安装CRM2016的SSRSReportingExtensions时遇到以下报错:    二、解决方案:   a.根据提示,访问对应路径的文件夹:C:\ProgramFiles\MicrosoftSQLServer\MSRS13.MSSQLSERVER\ReportingServices,可以看到ReportManager文件夹并不存在; ......
  • inno setup 提前安装外围程序,比如.net framework
    [Files]Source:..\framework.exe;DestDir:{tmp};Flags:dontcopy[code]functionInitializeSetup():Boolean;varPath:string;ResultCode:Integer;beginExtractTemporary......
  • VAS5054A V19 setup steps
    TheVAS5054AV7.1.1isauniversaldiagnosticinterfaceforthevehiclesoftheVolkswagenGroupandallOBDvehiclesystemsfromothermanufacturers,mainlydoAUDIVWSeatSkoda,newlyaddBentleyandLamborghini.Itisbluetoothversion,anditsupport......
  • JUnit_setup()和teardown()
    简单的可以这样理解它们,setup主要实现测试前的初始化工作,而teardown则主要实现测试完成后的垃圾回收等工作。 需要注意的是Junit3中每个测试方法执行时都会执行它们,而不是一个类中执行一次,查了查资料,JUnit4版本采用注解的方式可以实现一个类只执行一次,下面看看测试代码: JUnit3.8.......
  • windows程序利用setup project项目进行打包安装
    编译好的C++项目可以通过visualstudio的setupproject项目进行打包安装1、利用dumpbin/dependents*.exe命令查看生成的运行文件所依赖的库dll,然后将相应库拷贝到即将打包的文件夹中,需使用x64NativeToolsCommandPromptforVS20192、下载扩展MicrosoftVisualStudio......
  • 更新 Python 的 setuptools 包
    [......