LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how to fix ssh connection refused please (https://www.linuxquestions.org/questions/linux-networking-3/how-to-fix-ssh-connection-refused-please-562469/)

keratos 06-17-2007 02:07 PM

how to fix ssh connection refused please
 
hi

i have the "ssh: connect to host desktop port 22: Connection refused" when connecting from host to remote.

ive scoured these forums and read about port 22 being blocked or something.

now, i am a linux n00b, running mandrake 10.2 and have no idea how to check with this O/S if the port is blocked , by what and how to "open" it.

please can someone provide instructions or a link to clear concise instructions on how to fix this.

laymen terms would be very much appreciated ;)

p.s. ive forwarded port 22 on the router.

dont know how to check whats wrong here?

acid_kewpie 06-17-2007 03:00 PM

what are you actually trying to achieve? what does "from host to remote" mean? is there a remote ssh service running? are there any internet connection based things you're not telling us?

keratos 06-17-2007 03:23 PM

Quote:

Originally Posted by acid_kewpie
what are you actually trying to achieve? what does "from host to remote" mean? is there a remote ssh service running? are there any internet connection based things you're not telling us?

erm ,like i said, i dont know the first thing about linux so what on earth do you want me to tell you.

all i know (from windows days) is that ssh requires port 22 open to the ssh daemon (sshd)

Ive opened a terminal window on my laptop which has wirelss connection to a WAP. the desktop is connected to the same WAP. I can ping both PCs from each other and browe the network.

I require ssh for rsync.

"desktop" is the netbios name for the remote machine im trying to contact from the host ("laptop" is the netbios name for the host)

its not that im not "telling" you anything , its that i dont know how to get what i want working, thats why im here.

acid_kewpie 06-17-2007 03:32 PM

ok, so with these both on a single subnet, it should be real easy. most likely is that the host itself is firewalled, or you don't have ssh running. to check the first, there'll be some firewall tool in your system menu or whatever mandriva has in that vein. alternatively, run "iptables -L" as root and that'll list your firewall rules, if there are any. as for the second, run "/sbin/pidof sshd" and if it returns a number, sshd is running.

keratos 06-17-2007 04:37 PM

Quote:

Originally Posted by acid_kewpie
ok, so with these both on a single subnet, it should be real easy. most likely is that the host itself is firewalled, or you don't have ssh running. to check the first, there'll be some firewall tool in your system menu or whatever mandriva has in that vein. alternatively, run "iptables -L" as root and that'll list your firewall rules, if there are any. as for the second, run "/sbin/pidof sshd" and if it returns a number, sshd is running.

BANG!

user error.

two machines with same static IP.

Duh!

sorry!

so thats working, ssh is okay and rsync works from command line, but...

how do I get rsync to sync remote/host folders at login and logout. bit off topic but you sound a guru ;)

I've created a .bash_login and .bash_logout with the rsyn commands in but they are not run at login and logout for some reason. I've chmod 755 the files and run them from interactive shell, the rsync command is fine and copies files to/from local/remote. just dont work at session login and logut.

???

BotKeeper 06-17-2007 06:23 PM

Quote:

Originally Posted by keratos
how do I get rsync to sync remote/host folders at login and logout. bit off topic but you sound a guru ;)

I've created a .bash_login and .bash_logout with the rsyn commands in but they are not run at login and logout for some reason. I've chmod 755 the files and run them from interactive shell, the rsync command is fine and copies files to/from local/remote. just dont work at session login and logut.

First, make sure you are using Bash as your shell. A
Code:

ps -f
will tell your current shell. You can look at /etc/passwd and see the default shell for your account.

My .bash_profile and .bash_logout do not have the +x protection flag as the files are "source'" (see Bash man page for source command). Do make sure you are the owner. You can also put a like like
Code:

echo "In file foo" >> /tmp/debug
to see what is happening.

keratos 06-18-2007 04:16 AM

definitely running bash.

No debug output.

Looks like the .bash_login and .bash_logout are not being read.

So far as I understand from the man page, bash runs at login: /etc/profile ~/.bash_profile and ~/.bash_login

whilst at logout the ~/.bash_logout is run.

I've no idea how to verify what is actually being run at these stages on my machine. can you assist please?

p.s. I'm running KDE not Gnome as in my sig. Changing my sig now!

kenji 06-18-2007 04:25 AM

I had the same problem before all i did was issue the $iptables -F command
and it flushed all the ipchains and it worked try it i might work. Hope this
helps| £Ä3

keratos 06-18-2007 06:07 AM

Quote:

Originally Posted by kenji
I had the same problem before all i did was issue the $iptables -F command
and it flushed all the ipchains and it worked try it i might work. Hope this
helps| £Ä3

ERRR....thanks for taking the time to drop in , but it was user error as stated in the posts .. above.

Oh, BTW .. your signature ... all that about M$ ... food for thought dear colleague ... if you are so learned you surely must be conscious that "a good teacher never criticises" , "if you have nothing good to say, say nothing at all" or how about "if you dont agree with something, then change it. If you can't change it, then change your attitude".

;) enjoy life

kenji 06-18-2007 07:38 PM

thank you keratos for your opinion about my signature
im really not a m$ basher but i it hate when they say
i don't understand how you did that and they don't
try to research about their problems and don't try to
figure out a way to solve it that is the reason i posted
my signature not to insult or anything but to tell some
linux newbies that you try things first if you can't
figure it out try google and posting in forums some
questions i often find some newbies ask the same
question over and over again and don't bother to take
time to research well there are times that they are busy
i understand but there are people who really don't try
thats all i hope you understand thank you again. i just
hate it when they whine thats all. linux is as easy as
windows if you really take the time to learn and that is
what i want to say thank you. i hope this would start a
flame or anything :) im not a linux guru its just that
i like linux and im comfortable with it and for me it is
easy thats all. again thanks. please no flames :) thanks| £Ä3


All times are GMT -5. The time now is 10:43 PM.