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

查看:40
本文介绍了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 之前解释过:一段文字当您打开与远程服务器的交互式会话时,需要终端.

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天全站免登陆