Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
I need to change my ssh port from 22. What is the line command for rh linux to do this????...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    15

    Question Changing ssh port by cl

    I need to change my ssh port from 22. What is the line command for rh linux to do this????

  2. #2
    Just Joined! sanjaykatiyar's Avatar
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    97
    You can change the Port value in the
    /etc/ssh/sshd_config file

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    15

    Question

    ok, so i changed the port and did a save. i even cat out the file again to make sure the port said it was changed. I then did a updatedb and tried to login internally using the new port i assigned but it wouldnt let me in. It still let me in under the old 22 port. What am i doing wrong???

  4. #4
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    You have to restart the ssh service so it will reread the config file.

  5. #5
    Just Joined! FireMaster's Avatar
    Join Date
    Feb 2008
    Location
    Bulgaria
    Posts
    9
    Quote Originally Posted by rcgreen View Post
    You have to restart the ssh service so it will reread the config file.
    try this:
    #service sshd restart

  6. #6
    Just Joined!
    Join Date
    Dec 2007
    Posts
    15
    is this what i use if i have redhat 5

  7. #7
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Firemaster posted correct command for RHEL 5
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  8. #8
    Just Joined!
    Join Date
    Dec 2007
    Posts
    15

    Unhappy

    neither of the commands worked



    [root@localhost m*****]# service ssh restart
    bash: service: command not found
    [root@localhost m*****]# service sshd restart
    bash: service: command not found
    [root@localhost mol*****]# /etc/init.d/ssh restart
    bash: /etc/init.d/ssh: No such file or directory
    [root@localhost m*****]# sudo /etc/init.d/ssh restart
    sudo: /etc/init.d/ssh: command not found
    [root@localhost m*****]# cd
    [root@localhost ~]# cd
    [root@localhost ~]# serice sshd restart
    bash: serice: command not found

  9. #9
    Just Joined!
    Join Date
    Jan 2007
    Posts
    4
    It's service sshd restart. You're typing service ssh restart. The original poster entered the correct command, you just missed a letter =)

  10. #10
    Just Joined!
    Join Date
    Dec 2007
    Posts
    15

    Question

    Quote Originally Posted by campee View Post
    It's service sshd restart. You're typing service ssh restart. The original poster entered the correct command, you just missed a letter =)
    if you looked at it i posted both.... and both gave the samething

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...