LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-23-2007, 12:47 PM   #1
Raakh
Member
 
Registered: May 2007
Posts: 128

Rep: Reputation: 15
Problem with changing the ssh port


I edited /etc/ssh/sshd_config and changed the port then I used the following command

service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@server ~]# ssh -p 9 209.62.86.14
ssh: connect to host 209.62.86.14 port 9: Connection refused

Thanks & best regards
 
Old 12-23-2007, 01:04 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,970
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Did you enable root login?
 
Old 12-23-2007, 01:14 PM   #3
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
Try loggin in as a regular user.
 
Old 12-23-2007, 01:20 PM   #4
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by custangro View Post
Did you enable root login?
I am running this command from root

I get apology if didn't understand what you mean as am totally blank but trying to do with some articles

could you please be more specific

thanks & best regards
 
Old 12-23-2007, 01:22 PM   #5
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Kahless View Post
Try loggin in as a regular user.
I changed the root user and tried from other user but the same error
-bash-3.00$ ssh -p 1214 209.62.76.34
ssh: connect to host 209.62.86.14 port 1214: Connection refused
-bash-3.00$
 
Old 12-23-2007, 01:46 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
ssh -vvv -p 1214 209.62.76.34
Will give you a verbose output, which may help to find the problem.
If you have firewall(s), they'll need to be aware of the new ssh port assignment.
Also, most (default) ssh configurations will sensibly not allow a connection as root.
 
Old 12-23-2007, 01:50 PM   #7
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,970
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by Raakh View Post
I am running this command from root

I get apology if didn't understand what you mean as am totally blank but trying to do with some articles

could you please be more specific

thanks & best regards
I asked because by default you aren't allowed to ssh as root (you have to enable that). And, I noticed that you were trying to ssh as root.

Have you tried editing the /etc/ssh/sshd_config file on the other end (the machine that you are trying to ssh to)?

-C
 
Old 12-23-2007, 01:52 PM   #8
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
ssh -vvv -p 1214 209.62.76.34
Will give you a verbose output, which may help to find the problem.
If you have firewall(s), they'll need to be aware of the new ssh port assignment.
Also, most (default) ssh configurations will sensibly not allow a connection as root.
[root@server ~]# ssh -vvv -p 1214 209.62.76.34
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 209.62.76.34 [209.62.76.34] port 1214.
debug1: connect to address 209.62.76.34 port 1214: Connection refused
ssh: connect to host 209.62.76.34 port 1214: Connection refused
[root@server ~]#
 
Old 12-23-2007, 01:55 PM   #9
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by custangro View Post
I asked because by default you aren't allowed to ssh as root (you have to enable that). And, I noticed that you were trying to ssh as root.

Have you tried editing the /etc/ssh/sshd_config file on the other end (the machine that you are trying to ssh to)?

-C
ssh as root is already enabled

yes I written in my very first post that I edited the /etc/ssh/sshd_config file by editing the port
 
Old 12-23-2007, 01:58 PM   #10
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
ssh as root is already enabled
That was not sensible. See the many posts on this in LQ's Security forum.
 
Old 12-23-2007, 02:12 PM   #11
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
That was not sensible. See the many posts on this in LQ's Security forum.

#PermitRootLogin yes
 
Old 12-23-2007, 04:32 PM   #12
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,970
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by Raakh View Post
#PermitRootLogin yes
The "#" in front suggest that ssh as root is NOT enabled since it's commented out....

-C
 
Old 12-23-2007, 04:55 PM   #13
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Rep: Reputation: 31
firewall

are you logging in locally or from a remote machine through the internet? Maybe you are being firewalled somewhere int he process. Also, try a higher port number; maybe your ISP is blocking the port you are using.

- JB
 
Old 12-24-2007, 03:23 AM   #14
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jimbo1708 View Post
are you logging in locally or from a remote machine through the internet? Maybe you are being firewalled somewhere int he process. Also, try a higher port number; maybe your ISP is blocking the port you are using.

- JB
I am logging from internet and I changed the port to 1024 but still have the problem
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto do Secured ssh from port https or port80(standard) to ssh d listening port 22 ? Xeratul Linux - General 4 11-23-2006 07:09 AM
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 10:10 AM
Changing the port on SSH Coldmiser SUSE / openSUSE 5 03-29-2006 09:25 PM
changing ssh port dannyk1 Linux - Security 7 06-17-2005 09:05 AM
Changing SSH Port taran Linux - Networking 2 08-11-2003 12:06 AM


All times are GMT -5. The time now is 09:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration