How to change my IP address when using SSH?

Posted on 2011-05-09
Last Modified: 2012-05-11
I have a server with a firewall configured to only accept certain IP addresses for SSHing.  I'm not at my apartment using my IP address that I can access it with.  But I do know my IP address at my apartment.

Is it possible to use SSH and give it the IP address I want to use?

Thanks for any help!
Question by:parlays
    LVL 12

    Expert Comment

    <<I have a server with a firewall configured to only accept certain IP addresses for SSHing>>
    The blocking of the IPs is done by the firewall.
    Hence you must modify the firewall rules to allow access of the IP from your apartment.

    Once you are able to get pass the firewall you should be able to SSH.


    Accepted Solution

    You generally can't just use an IP address of another device - that would create all sorts of issues. However, have you considered SSHing to a computer that can SSH to the server?

    As in Computer At Your Aparment > SSH > Computer that can access server > SSH > Server?

    Otherwise, asidu is right, just change the firewall to allow access from your apartment IP.

    Author Comment

    I might not have been clear, im not at my apartment, which has an IP that can access the server.  At my current location, can I spoof or use that IP by manually typing it somewhere?
    LVL 16

    Assisted Solution

    No you can't

    If you pretend to have another IP-address, then the ssh servers ansers would be setn back to this IP-address and not to the host you're connecting from.

    LVL 9

    Assisted Solution

    Spoofing an IP address is pretty tricky to do, from what I understand.  In the event that you could, would you really care about only allowing those certain IP's anymore?

    If you're worried about script kiddies breaking into the server, here are measures that minimize the server's attack surface while giving the most flexibility:
     1.) configure the firewall to forward a non-standard port to your server's SSH port (22).
     2.) use something like denyhosts [ ] to block abusers
     3.) disallow root access

    Allowing root access on the standard SSH port is the surest way of having the server compromised.  The above tactics are the most secure method I've found without having to go so far as to using IP-based access (which can really go wrong if you only allow your home IP to access, then it changes).
    LVL 1

    Assisted Solution

    Basically, NO.

    The IP address that belongs to your apartment even if it is from the same ISP that you are connected right now cannot be used elsewere. I you can Spoof the IP address (make believe that you have that IP address) it may get there, but on the way back (the ACK of the TCP session) it will go back to the original device that has that IP.

    hope that help..

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    Hello to you all, I hear of many people congratulate AWS (Amazon Web Services) on how easy it is to spin up and create new EC2 (Elastic Compute Cloud) instances, but then fail and struggle to connect to them using simple tools such as SSH (Secure…
    Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now