Solved

DD-WRT SSH PORT

Posted on 2010-11-27
9
941 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 76

Expert Comment

by:arnold
Comment Utility
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
Comment Utility
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
Comment Utility
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 76

Expert Comment

by:arnold
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Author Comment

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

Author Comment

by:toroblanco2002
Comment Utility
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 76

Accepted Solution

by:
arnold earned 150 total points
Comment Utility
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
Comment Utility
Thank you
0
 
LVL 3

Author Comment

by:toroblanco2002
Comment Utility
Thank you I will check it out.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

12 Experts available now in Live!

Get 1:1 Help Now