Solved

DD-WRT SSH PORT

Posted on 2010-11-27
9
942 Views
Last Modified: 2012-05-10
I made mistake I change ssh default port from 22 to 443.
I need to know how to change it back via ssh.
0
Comment
Question by:toroblanco2002
  • 6
  • 3
9 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 34226537
ssh user@ipaddress -p 443
nvram set sshd_wanport=22 sshd_port=22

or run nvram show | grep 443 after your login and update the variables with SSHD in them.
0
 
LVL 3

Author Comment

by:toroblanco2002
ID: 34226656
It did not work I try both of the commands.
At least if i will know where the sshd_config file on my router is I will attempt to edit it. Thats really what I'm looking for.  I thought it on /etc/ssh/sshd_config but is not there. I was able to see it once but I did not pay attention on what directory.
0
 
LVL 3

Author Comment

by:toroblanco2002
ID: 34226706
I now that I notice one of the commands I'm not sure which one did change the remote port to 22. But I want to change the default por not the remote port. will changing the wanport =22 to localport=22 will do it?
0
 
LVL 77

Expert Comment

by:arnold
ID: 34226735
run/executed after you login into the dd-wrt router with ssh
nvram show | grep -i ssh

what is being returned? with 443?
update that with nvram set sshd_port=22

The settings are set within the nvram versus having a /etc/ssh/sshd_config as is usually where the sshd config is on a linux.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Author Comment

by:toroblanco2002
ID: 34227267
Ok, after run nvram set sshd_port=22 what command should I run to save the changes?
0
 
LVL 3

Author Comment

by:toroblanco2002
ID: 34227341
I think this is going to work... I have one more question... do you know how can create a simple bash script to ping one of my computers every 10 min to check if is up and email me if the pc is down.
this is example of what if have some gave me this.

#!/bin/bash
ping -c 3 192.168.1.1
if [[ $? != 0 ]]; then
    date '+%m/%d - %H:%M : Connection Unavailable' >> /var/log/monitor.log
    mail -s "Server down, oh noes!" email@email.net < /var/log/monitor.log
else
    date '+%m/%d %H:%M : Connection Available' >> /var/log/monitor.log
fi

I'm new to all this I'm to learn so how can I put this script inside the router and make functional.

Thanks I will increase the points on this questions if is require to get this done, I will really appreciate your help.
0
 
LVL 77

Accepted Solution

by:
arnold earned 150 total points
ID: 34227553
Emailing components are not available within dd-wrt setup to make this possible.
you would need to add components to your install.
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=16041

A good opensource monitoring network/data collection tool is nagios, openNMS, cacti.


nvram commit

saves/writes the changes that will survive a power cycle.
0
 
LVL 3

Author Comment

by:toroblanco2002
ID: 34227598
Thank you
0
 
LVL 3

Author Comment

by:toroblanco2002
ID: 34227607
Thank you I will check it out.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A short film showing how OnPage and Connectwise integration works.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now