LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   why does ssh to my server give me a blank shell? (http://www.linuxquestions.org/questions/linux-server-73/why-does-ssh-to-my-server-give-me-a-blank-shell-892857/)

gnyrfta 07-21-2011 12:47 AM

why does ssh to my server give me a blank shell?
 
Good morning!

This is my first attempt at ssh and I ran into the following problem - tried to find an answer and maybe it is an obvious one but haven't found it yet - :

i can log into my server using ssh (both from windows via Putty and from my puredyne computer using the terminal), but once I've logged in there is only a blank terminal that doesn't respond to commands. It is as if I had gotten up a notebook where I can write stuff, but the computer doesnt give a hoot what it is! : )

Ideas? Am i missing something?

thx for any help!:)

leenucks 07-21-2011 01:20 AM

do you have a shell(korn, bash, ksh) defined?

Jadedkill 07-21-2011 09:53 AM

It is possible your 'sshd' is not running properly. This can usually be fixed by restarting the 'sshd' service via the commands:

#sudo /etc/init.d/ssh stop
#sudo /etc/init.d/ssh start

When did the problem start and what steps have you taken already?

gnyrfta 07-22-2011 07:55 AM

terminal
 
Thanks for the answers!
on my server I have bash. I think puredyne uses bash too - could it make a difference?

I am gonna try the other suggestion once I get to my server, which is remote...:)

Jadedkill 07-22-2011 08:34 AM

To further your investigation, you may want to look at some documentation on how to configure the ssh.conf file to ensure it is configured properly. There are some links below. This is assuming you are trying to access a Ubuntu server. It should make no difference if you are running different shells on each machine. SSH is just a bit smarter 'dumb terminal'. A gateway application for remote management of servers. It will present you with the shell the remote server is running.

http://www.cyberciti.biz/tips/howot-...sh-server.html
https://help.ubuntu.com/community/SS...SH/Configuring
https://help.ubuntu.com/8.04/serverg...sh-server.html

I hope this helps you get it fixed. My guess if going to be a bad config file. Double check your settings and as a last resort remove the packages and reinstall them.

Thanks!

catkin 07-22-2011 09:10 AM

Quote:

Originally Posted by Jadedkill (Post 4422296)
It will present you with the shell the remote server is running.

Should it not rather present you with the shell configured for the user you have just logged in as, as defined by the 7th field of their entry in /etc/passwd or /bin/sh by default.

gnyrfta 07-22-2011 03:46 PM

gnyrfta
 
Thanks loads for the answers! I will get to my desktop server tomorrow evening and then I can check out the sshd config file and the other suggestions!

gnyrfta 07-24-2011 10:29 AM

changed stuff
 
Ok, so now I finally got to my server today sunday, and I looked through the sshd_config file again. I realized that "AllowUsers" had been set to "username" instead of "username@ip#". I wasn't sure if this was ok, so i decided to comment out AllowUsers, since the default is that all users are allowed login.

I set the file to chmod 755, which it already was, but after i chmoded it, it showed green in the terminal, which I optimistically take as a good sign.

I set my firewall ufw to allow port 22.

Now I'm going home to try to access the server again.. will give an update on how that goes.:)

Ps. https://calomel.org/openssh.html is also a pretty good info page on ssh Ds.

gnyrfta 07-24-2011 10:30 AM

restar
 
and I started and restarted ssh as suggested - thx!

catkin 07-24-2011 10:53 AM

Does that mean it's all working for you now?

Threads can be marked SOLVED via the Thread Tools menu.

gnyrfta 07-24-2011 03:53 PM

no go
 
Got home, tried to connect with ssh and still get the same result.

This is my sshd_config file on the server computer(which runs ubuntu):


Code:

Port 22
Protocol 2

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

UsePrivilegeSeparation yes

KeyRegenerationInterval 3600
ServerKeyBits 768

SyslogFacility AUTH
LogLevel INFO

LoginGraceTime 120
PermitRootLogin no
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes

IgnoreRhosts yes

RhostsRSAAuthentication no

HostbasedAuthentication no

PermitEmptyPasswords no

ChallengeResponseAuthentication no

PasswordAuthentication yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes

Banner /etc/issue

AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

UsePAM yes
AllowTcpForwarding yes


Reuti 07-24-2011 04:00 PM

Is there any difference whether you enter the correct or a wrong password by intention? If you enter any command in such a session (i.e. blindly something like ls) do you get any output? You can run ssh it with -vvv to get verbose output of the connection.

gnyrfta 07-25-2011 01:19 AM

no password asked for
 
when i write ssh "hostuser@ip#" the cursor jumps down a step, and upon entering commands such as ls it doesnt give any response. Im not required to be root. Neither does anything different happen if i enter a random ip# instead of my own.

After a minute or two, i get:

ssh: connect to host ip# port 22: Connection timed out
zsh: exit 255 sudo ssh david@ip#

gnyrfta 07-25-2011 01:28 AM

ssh -vvv
 
on using -vvv the process gets hung up on "Connecting to ip# port 22"

I'll see if I can try a friends computer and see if its just my connection...

Internet isn't a problem though, so it would be weird?

Reuti 07-25-2011 04:07 AM

Then you don’t have a connection at all, and not a blank screen because of any shell setting. Even with putty you would get the question for your password otherwise. Is there any firewall on port 22 on the target machine?


All times are GMT -5. The time now is 03:43 AM.