How can I specific local port when establish ssh connection?How do I tunnel SSH over SSH?SSH client...
Golf the smallest circle!
Why does a brace command group need spaces after the opening brace in POSIX Shell Grammar?
Being paid less than a "junior" colleague
Can I ask to speak to my future colleagues before accepting an offer?
Is there reliable evidence that depleted uranium from the 1999 NATO bombing is causing cancer in Serbia?
Why was Mal so quick to drop Bester in favour of Kaylee?
How to fix a dry solder pin in BGA package?
Details of video memory access arbitration in Space Invaders
Can I travel from Germany to England alone as an unaccompanied minor?
Different budgets within roommate group
Are these intended activities legal to do in the USA under the VWP?
Averting Real Women Don’t Wear Dresses
Do space suits measure "methane" levels or other biological gases?
Should I report a leak of confidential HR information?
I hit a pipe with a mower and now it won't turn
How can I get edges to bend to avoid crossing?
How hard is it to sell a home which is currently mortgaged?
3D nonogram, beginner's edition
Why is my line not appearing smooth?
What's the safest way to inform a new user of their password on my web site?
Inquiring about the possibility of a job
Does Anosov geodesic flow imply asphericity?
Why transcripts instead of degree certificates?
Questions about authorship rank and academic politics
How can I specific local port when establish ssh connection?
How do I tunnel SSH over SSH?SSH client connection not working to remote servers not workingSSH Server not answering connection requestsRestart a specific reverse ssh tunnel?Which processes do the ports (as communication connection endpoints) belong to in SSH port forwarding?SSH tunnel with different ssh portSSH session through jumphost via remote port forwardingCan't establish ssh connection: “debug1: read_passphrase: can't open /dev/tty: No such file or directory” and “Host key verification failed.”Can't do reverse SSH tunneling in LOCAL networkCan not access ssh fowarding port
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have two servers hosted in IDC. I can only use these port 20/21/22/23/3389/33101-33109 to establish connection between two server. The IDC network device will block any other package which source port or destination port not in 20/21/22/23/80/3389/33101-33109. But the source port of ssh is random. There is wild known that using command
ssh username@server -p remote_port
can easily specific remote port. So is there a parament or some way can specific local port so I can using maybe port 33101 to eastablish ssh connection?
My network topo just like this:
ssh
New contributor
add a comment |
I have two servers hosted in IDC. I can only use these port 20/21/22/23/3389/33101-33109 to establish connection between two server. The IDC network device will block any other package which source port or destination port not in 20/21/22/23/80/3389/33101-33109. But the source port of ssh is random. There is wild known that using command
ssh username@server -p remote_port
can easily specific remote port. So is there a parament or some way can specific local port so I can using maybe port 33101 to eastablish ssh connection?
My network topo just like this:
ssh
New contributor
add a comment |
I have two servers hosted in IDC. I can only use these port 20/21/22/23/3389/33101-33109 to establish connection between two server. The IDC network device will block any other package which source port or destination port not in 20/21/22/23/80/3389/33101-33109. But the source port of ssh is random. There is wild known that using command
ssh username@server -p remote_port
can easily specific remote port. So is there a parament or some way can specific local port so I can using maybe port 33101 to eastablish ssh connection?
My network topo just like this:
ssh
New contributor
I have two servers hosted in IDC. I can only use these port 20/21/22/23/3389/33101-33109 to establish connection between two server. The IDC network device will block any other package which source port or destination port not in 20/21/22/23/80/3389/33101-33109. But the source port of ssh is random. There is wild known that using command
ssh username@server -p remote_port
can easily specific remote port. So is there a parament or some way can specific local port so I can using maybe port 33101 to eastablish ssh connection?
My network topo just like this:
ssh
ssh
New contributor
New contributor
New contributor
asked 1 hour ago
fajin yufajin yu
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
you can not specify the source port for ssh client.
but you can use nc
as a proxy, like this:
ssh -p 33101 -o 'ProxyCommand nc -p 33101 %h %p' $SERVER_2
refer:
https://serverfault.com/questions/920007/how-can-i-set-the-source-port-for-ssh-on-unbuntu-server
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
fajin yu is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f526745%2fhow-can-i-specific-local-port-when-establish-ssh-connection%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
you can not specify the source port for ssh client.
but you can use nc
as a proxy, like this:
ssh -p 33101 -o 'ProxyCommand nc -p 33101 %h %p' $SERVER_2
refer:
https://serverfault.com/questions/920007/how-can-i-set-the-source-port-for-ssh-on-unbuntu-server
New contributor
add a comment |
you can not specify the source port for ssh client.
but you can use nc
as a proxy, like this:
ssh -p 33101 -o 'ProxyCommand nc -p 33101 %h %p' $SERVER_2
refer:
https://serverfault.com/questions/920007/how-can-i-set-the-source-port-for-ssh-on-unbuntu-server
New contributor
add a comment |
you can not specify the source port for ssh client.
but you can use nc
as a proxy, like this:
ssh -p 33101 -o 'ProxyCommand nc -p 33101 %h %p' $SERVER_2
refer:
https://serverfault.com/questions/920007/how-can-i-set-the-source-port-for-ssh-on-unbuntu-server
New contributor
you can not specify the source port for ssh client.
but you can use nc
as a proxy, like this:
ssh -p 33101 -o 'ProxyCommand nc -p 33101 %h %p' $SERVER_2
refer:
https://serverfault.com/questions/920007/how-can-i-set-the-source-port-for-ssh-on-unbuntu-server
New contributor
New contributor
answered 4 mins ago
PapErPapEr
11 bronze badge
11 bronze badge
New contributor
New contributor
add a comment |
add a comment |
fajin yu is a new contributor. Be nice, and check out our Code of Conduct.
fajin yu is a new contributor. Be nice, and check out our Code of Conduct.
fajin yu is a new contributor. Be nice, and check out our Code of Conduct.
fajin yu is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f526745%2fhow-can-i-specific-local-port-when-establish-ssh-connection%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown