Login to Linux Server via Putty

I cannot login to a Linux server from my Windows XP PC. I was told to use Putty. I installed Putty (Release 0.60) on my PC and launch it.

In the Putty screen I type in the server name and choose Telnet (or SSH). Whatever I choose I get logon screen. I type in my ID and password. As soon as I enter password the screen closes and nothing happens.

I know I am given access to the server. Could it be the wrong way that I am trying to access the server?

Cmmand line telnet to the server does not work.
toookiAsked:
Who is Participating?
 
giltjrCommented:
After you logon try issuing the command:

     echo $PATH

If that does not work then issue the command:

     /bin/echo $PATH

Somthing could be changing your path.
0
 
TintinCommented:
If you get the login screen, and the screen closes after you put your login details in, it suggests you don't have access to the server (at least a non-usable shell)
0
 
AriMcCommented:
You would need to know what authentication methods are allowed on the server you're trying to connect to. Chances are it only accepts private/public keys.

0
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
Kerem ERSOYPresidentCommented:
Hi,

Most distros disable telnet by default. So I guess trying to access the system with SSH would be better if telnet was not explicitly enabled.

When you logon to the system it just closes the session could mean several things:
- If you're trying to logon with root user some systems would not allow remote root logon.
- The account you're using does not have a properly set shell or home directory.

So if you have physical access to the server please check the /var/log/messages and security files to see the result of your remote logon attempts.

When you do so pleas post the contents here too.

Chers,
K.

0
 
Diogo UchoasNetwork and Security AnalystCommented:
Hello,

check on /etc/passwd if the user has the correct setting for bash path:
kunx:x:1000:100:KunX:/home/kunx:/bin/bash

Open in new window

and on /etc/ssh/sshd_config check these settings:
PasswordAuthentication yes
PermitRootLogin yes

Open in new window


0
 
toookiAuthor Commented:
Thank you all for the help. I do not have physical access to the server. I will follow all your comments above and will get back to you.
0
 
gelonidaCommented:
It might be, that you do not have interactive access to the server, that you cannot connect to a shell window and type commands.

Did you try to connect to the server with ftp or sftp?

a simple test would be to type
telnet yourhostname
on the windows cmd prompt
or to enter
ftp://userid@yourhostname

in a windows explorer window


Perhaps this is all what you are allowed to.

0
 
JordanlcnCommented:
First off what exactly are you trying to do?  I mean why do you want to log in to the server?  I mean you used Putty but why that?

Maybe if you can tell us a little something one what you want to do then maybe we can help you more.

Did you the person who gave you access (username and password) is the same person who told you to use putty?
0
 
giltjrCommented:
Whomever does have access should be able to look at the logs and tell you why you can't get in.

However, you need to make sure you are entering the correct user-id and password.  My initial guess is that you are putting in your Windows user-id and password an more than likely this is not valid on the Linux box.  You may have been given an different user-id and password.
0
 
toookiAuthor Commented:
Thanks all. I made some progress but having problems still.
I need to login to the Linux server. Usually I am on a Windows XP PC. If I try to telnet to the  Linux server, it does not work. Someone said I need to use Putty. so I installed via Putty with "SSH" option.
Now I can login. But it seems I am not being able to do anything much after loggin in. I am logged in as a regular user (not root).
This is the error messages I see right after I login .

After I login to the Linux server, I need to set a cron job on the server. That cronjob will run a command to connect to a MySQL database and dump the database's certain content on a text file. This entire process works on a Sun Solaris10 server. I need to do the same on this Linux server.
/home/tryq11/.kshrc[6]: stty: not found [No such file or directory]
/home/tryq11/.kshrc[7]: stty: not found [No such file or directory]
/home/tryq11/.kshrc[8]: tabs: not found [No such file or directory]
/home/tryq11/.kshrc: line 19: hostname: not found
/home/tryq11/.kshrc: line 39: MANPATH: parameter not set
:/home/tryq11> ls
-ksh: /usr/misc/bin/ls: not found [No such file or directory]

Open in new window

0
 
Kerem ERSOYPresidentCommented:
Hi,

You can not login to SSH because it seems that RootLogin through ssh is disabled. Whether you can enable it (it is no suggested in most environments since it decreases security).

Another option is to become root using the command su such as :

su -

This will allow you to be root user.

Another problem is it seems that your .kshrc has some errors in it. Will you please post the contents of the file here?

0
 
giltjrCommented:
Are you supposed to be able to su (or sudo) as root?

Although we can help you, these issues should be taken care of by somebody that does have root access to this box.
0
 
toookiAuthor Commented:
Currently I am not having root access.
I requested "su" access to be root. I am waiting to get the access. After I get it I will see if I still get these errors.
0
 
giltjrCommented:
My second post asking about root was more intended for after you get your current login issue resolved.

Until you are able to login, having su/sudo authority will not matters.

You still need to resolve the login issue first and only somebody that can login and has root access can resolve that.  They need to see why you are getting rejected.
0
 
toookiAuthor Commented:
Yes, I wanted to get the login issue resolved but got no help from the sysadmin so far.
I get the login error but I got the root access and can become root on the server.
/home/tryq11/.kshrc[6]: stty: not found [No such file or directory]
/home/tryq11/.kshrc[7]: stty: not found [No such file or directory]
/home/tryq11/.kshrc[8]: tabs: not found [No such file or directory]
/home/tryq11/.kshrc: line 19: hostname: not found
/home/tryq11/.kshrc: line 39: MANPATH: parameter not set
:/home/w12390> ls
-ksh: /usr/misc/bin/ls: not found [No such file or directory]
:/home/w12390>  pbrun ksh
Type in w12390's password:
#
#id
uid=0(root) gid=1(other) groups=117(user)
#

How can I now fix the login error issue
I can go to the directory /home/w12390 as root and now I can ls to see the files  (via ls -al)
-rw-r--r--   1 w12390    user        134 Nov 30  2009 .cshrc
-rw-r--r--   1 w12390    user       2355 Nov 22 21:53 .kshrc
-rw-------   1 w12390    user         35 Nov 15 12:32 .lesshst
-rw-r--r--   1 w12390    user        607 Nov 30  2001 .login
-rw-------   1 w12390    user          0 Feb 25 15:55 .mysql_history
-rw-r--r--   1 w12390    user       1312 Nov 22 22:04 .profile
-rw-------   1 w12390    user       4096 Feb 10 17:26 .sh_history
drwx------   2 w12390    user         80 Oct 20 01:14 .ssh
-rw-r--r--   1 w12390    user       1346 Jun 30  2005 .tcshrc

 
0
 
giltjrCommented:
You want to look in the file .kshrc to see what it is trying to do.   You will also what to look at .profile and look at /etc/.kshrc and /etc/.profile.  I would not touch the files in /etc, just look.  
0
 
upanwarCommented:
It seems that your sysadmin has given you restricted shell that's why you are not able to run ls command and getting error at time of login as well, It the restricted shell user can run certain command only.

I have seen this sort of issue where user was given restricted sheel to SSH the system then he/she can become root to perform his/her activity.

The error you are getting shows that PATH is not set or the commands are not in your PATH.

:/home/w12390> ls
-ksh: /usr/misc/bin/ls: not found [No such file or directory]


ls command resides in /bin/ls but in your case it is going to look at /usr/misc/bin/ls

0
 
toookiAuthor Commented:
Thank you...
This is the part of the .kshrc file under my home directory (/home/w12390/)
Looks like the 2nd line includes the path /bin in the PATH variable. So ls command should have worked as ls is in /bin/ls

If I try from the command /bin/ls it works./bin/vi works too .

PATH=/usr/admin/bin:/usr/lib/nis:/usr/sbin
PATH=$PATH:/bin:/usr/bin:/etc:/usr/etc:/usr/sbin:/usr/lib
PATH=$PATH:/usr/misc/bin:/usr/atria/bin:.
PATH=$PATH:/usr/vendor:/usr/vendor/bin:/usr/local/bin:/usr/openwin/bin
PATH=$PATH:/usr/openwin/bin:/usr/global/bin:/usr/dt/bin:/opt/SUNWspci/bin
PATH=$PATH:/usr/global/admin/bin:/usr/global/admin/WWW/bin:/usr/global/share
PATH=$PATH:/usr/local:/usr/ucb:/u/global/bin:/opt/hpnpl/admin
PATH=$PATH:/opt/SUNWdat/bin
PATH=$PATH:/apps/android/bin

Open in new window

0
 
toookiAuthor Commented:
I do not see any file name: /etc/.kshrc
0
 
toookiAuthor Commented:
This is what I get. I see /bin in the path.
:/home/w12390> echo $PATH
/usr/admin/bin:/usr/lib/nis:/usr/sbin:/bin:/usr/bin:/etc:/usr/etc:/usr/sbin:/usr/lib:/usr/misc/bin:/usr/atria/bin:.:/usr/vendor:/usr/vendor/bin:/usr/local/bin:/usr/openwin/bin:/usr/openwin/bin:/usr/global/bin:/usr/dt/bin:/opt/SUNWspci/bin:/usr/global/admin/bin:/usr/global/admin/WWW/bin:/usr/global/share:/usr/local:/usr/ucb:/u/global/bin:/opt/hpnpl/admin:/opt/SUNWdat/bin:/apps/android/bin

Open in new window

0
 
giltjrCommented:
Ah, I wonder if somebody has setup an alias for the ls command.  Try issuing the command:

     alias

and see what it shows.
0
 
toookiAuthor Commented:
This is what I get:
# alias
2d='set -f;_2d'
autoload='typeset -fu'
command='command '
compound='typeset -C'
fc=hist
float='typeset -lE'
functions='typeset -f'
hash='alias -t --'
history='hist -l'
integer='typeset -li'
nameref='typeset -n'
nohup='nohup '
r='hist -s'
redirect='command exec'
source='command .'
stop='kill -s STOP'
suspend='kill -s STOP $$'
times='{ { time;} 2>&1;}'
type='whence -v'
#

Open in new window

0
 
toookiAuthor Commented:
I had some incorrect aliases in .kshrc file. And that file was called from .profile file. The aliases set om .kshrc file did override the ones in .profile so ls and vi  were pointing to wrong places. I got it fixed now.

Thank you all for help.
0
 
giltjrCommented:
Glad you found it.  It's weird that they did not show up on the alias command.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.