ssh command -T option

社会主义新天地 提交于 2020-01-21 07:54:07

问题


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 !

Could somebody explain?


回答1:


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

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)

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. 

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



来源:https://stackoverflow.com/questions/47245185/ssh-command-t-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!