Solved

DD-WRT SSH PORT

Posted on 2010-11-27
9
947 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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
 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

809 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