• 累计撰写 781 篇文章
• 累计创建 1 个标签
• 累计收到 1 条评论

# SSH

2022-01-09 / 0 评论 / 0 点赞 / 31 阅读 / 1,077 字

/ 后端 / 部署 / SSH

Specifying a different user name
It is also possible to use a different username at the remote machine by entering the command as:
ssh alternative-username@sample.ssh.com
The above can also be expressed with the syntax:
ssh -l alternative-username sample.ssh.com
Executing remote commands on the server
The ssh command is often also used to remotely execute commands on the remote machine without logging in to a shell prompt. The syntax for this is:
ssh hostname command
For example, to execute the command:
ls /tmp/doc
on host sample.ssh.com, type the following command at a shell prompt:
ssh sample.ssh.com  ls /tmp/doc
After authenticating to the remote server, the contents of the remote directory will be displayed, and you will return to your local shell prompt. -x Disables X11 forwarding.

0