ssh命令-T选项 [英] ssh command -T option

查看:2053
本文介绍了ssh命令-T选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道以下命令中的-T选项的作用,以某种方式无法在手册中看到此选项:

I'm wondering what the -T option in the following command does, cannot see this option in the manual somehow:

$ ssh -T git@gitlab.com
Welcome to GitLab, Simeon !

有人可以解释吗?

推荐答案

解释了TTY是什么之前:当您打开与远程服务器的 interactive 会话时,需要使用终端.

I explained before what TTY was: a text terminal is needed when you open an interactive session to a remote server.

但是:在远程Git存储库托管服务器(GitHub,Gitlab,BitBucket等)的上下文中,没有远程服务器将允许您打开交互式会话(出于安全原因) )

But: in the context of a remote Git repository hosting server (GitHub, Gitlab, BitBucket, ...), no remote server will ever allow you to open an interactive session (for security reason)

您仍要执行ssh -T git@github.com的唯一原因是测试您是否通过了正确的身份验证,并且会话将立即结束:

Then only reason why you would still do an ssh -T git@github.com would be to test if you are correctly authenticated, and the session would immediately end with:

Hi username!  You've successfully authenticated, 
but GitHub does not provide shell access. 

由于该测试不需要tty,因此在进行此测试时应使用-T选项.

Since no tty is needed for that test, you should use the -T option when making this test.

这篇关于ssh命令-T选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆