Answer the question
In order to leave comments, you need to log in
How to set port in ssh command parameters?
I set up access by key, disabled it by password, changed the standard port 22 to my own.
I set up port knocking
. And when I try to log in to the local host
ssh 192.168.0.100 -l root
, the connection error says that it is trying to do this on port 22, and not on the one that I changed.
PS. When the iptables deny rule is removed, the connection proceeds normally.
Answer the question
In order to leave comments, you need to log in
For the ssh command - the -p flag and port:
For scp - the -P (capital) flag and port:
For rsync - through the -e flag, you can specify a custom shell, respectively, we give ssh there with the -p flag: UPD: In addition, you can in the folder ~/.ssh (where the keys are) create a file called config (without extension) and set aliases and many settings for the necessary hosts, including the port, default user and alternative key, after which it will be possible to write only an alias in all ssh utilities: Documentation on available options Plugin for vscode for highlighting and auto-completion in ~/.ssh/config file ssh -p 2222 [email protected]
ssh alias
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question