Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you are on server's terminal, can you connect to your system from server?
You haven't told your linux distribution of your server. I am assuming it is debian based.
Open server's terminal and run
Quote:
sudo /etc/init.d/ssh restart
if still it does not restart it, now run
Quote:
which service
what is output of it.
These all commands you need to run on server's terminal.
If you are not able to connect to server using ssh then you can not run these commands on server's command prompt from your system.
You need to open server's terminal physically and run these commands there.
If you are on server's terminal, can you connect to your system from server?
You haven't told your linux distribution of your server. I am assuming it is debian based.
Open server's terminal and run
if still it does not restart it, now run
what is output of it.
These all commands you need to run on server's terminal.
If you are not able to connect to server using ssh then you can not run these commands on server's command prompt from your system.
You need to open server's terminal physically and run these commands there.
Quote:
sudo /etc/init.d/ssh restart
gives this error:
Quote:
sudo: /etc/init.d/ssh: command not found
while this doesn't give any results.
Quote:
which service
I used to be able to connect like this, this morning I used
Quote:
sudo service ssh restart
to restart the ssh and ever since then this hasn't worked.
If you are on server's terminal, can you connect to your system from server?
You haven't told your linux distribution of your server. I am assuming it is debian based.
Open server's terminal and run
if still it does not restart it, now run
what is output of it.
These all commands you need to run on server's terminal.
If you are not able to connect to server using ssh then you can not run these commands on server's command prompt from your system.
You need to open server's terminal physically and run these commands there.
I'm really sorry to ask but I've still not managed to get this sorted. Would you mind talking me through doing this from the very beginning? I'm more than happy to pay for your help but I'm so desperate to get this sorted.
as far as I can tell you still haven't answered questions that you've been asked. First off what distro is this? The output of the following command should provide that information
as far as I can tell you still haven't answered questions that you've been asked. First off what distro is this? The output of the following command should provide that information
Code:
lsb_release --all
Evo2.
I'm sorry I'm not being to be awkward I don't know what distro it is. This is the first time I've ever used this before so don't know how to find out. I know that it was set up using AWS EC2 and runs Ubuntu.
I opened the Terminal then typed that in but it said: -bash: lsb_release: command not found Should I be doing something before I try to type that?
That just gave me this: cat: /etc/*release*: No such file or directory
Sorry to be so dumb but can we go right back to the beginning as I'm sure I'm doing something wrong.
If I open Terminal what should be the first thing I should do?
I'm more than happy to pay for help to get this fixed but I really need to get it sorted asap as my boss keeps asking about when they can see the changes and I can't upload anything at all at the moment
Unfortunatly, you've looked yourself out because the new port is firewalled...
Basically, you modified the port on which sshd service is running but you did not allow that port to accept connections on the server..
That is why you get "Connection refused" when trying to acces port 22 (which the firewall allows the connection but the port is unbinded and a reject is sent by the system -- it resembles a closed port) and you get a "Request timeout" when accesing port 1993 because the firewall simply drops all packets to that port and gives no further answer ..
The only way to fix this is by gaining acces to the server itself because SSH is now out of the question.. If you have such access or have any other means to gain such access to a terminal on the server, well, then we can help..
Unfortunatly, you've looked yourself out because the new port is firewalled...
Basically, you modified the port on which sshd service is running but you did not allow that port to accept connections on the server..
That is why you get "Connection refused" when trying to acces port 22 (which the firewall allows the connection but the port is unbinded and a reject is sent by the system -- it resembles a closed port) and you get a "Request timeout" when accesing port 1993 because the firewall simply drops all packets to that port and gives no further answer ..
The only way to fix this is by gaining acces to the server itself because SSH is now out of the question.. If you have such access or have any other means to gain such access to a terminal on the server, well, then we can help..
Thank you, I have access to the AWS console if that helps. I'm happy to try anything....
It should help but I'm not familiar with it and can't really help you out because of this.. Basically search if it can access the server's file-system and allows you to do a restart, then you're golden... just modify the SSH service back to port 22 and restart the server.. Or maybe it can directly modify the firewall? Or restart services (thus not needing a full restart of the (virtual) server).. I don't know exactly what AWS Console can do but any of these should be fine..
Last edited by Smokey_justme; 08-06-2014 at 06:35 AM.
Go to your EC2 AWS Console, under NETWORK & SECURITY click on Security Group, It will show up the security group you saw before. Click on it, it will show a split screen where the one is above has 2 tabs: Details and Inbound. Go to Inbound, in port range input 22 and source the ip you want to allow incoming access to instance. Don't forget to apply changes. http://docs.aws.amazon.com/gettingst...ity-group.html
Because still the port 22 is not opened on your server. You need to open it using AWS console what mentioned in above url.
So does that mean that I have to have port 22 open then in order to use SSH? Or do you just mean that port 22 has to be open on the server (not in the sshd_config file?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.