Solved

Login to Linux Server via Putty

Posted on 2011-02-24
24
1,085 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:toooki
  • 9
  • 7
  • 2
  • +6
24 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 34975603
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
 
LVL 9

Expert Comment

by:AriMc
ID: 34975643
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
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 150 total points
ID: 34975645
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
 
LVL 2

Expert Comment

by:Diogo Uchoas
ID: 34976747
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
 

Author Comment

by:toooki
ID: 34976857
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
 
LVL 16

Expert Comment

by:gelonida
ID: 34978203
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
 
LVL 3

Expert Comment

by:Jordanlcn
ID: 34978774
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
 
LVL 57

Expert Comment

by:giltjr
ID: 34980709
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
 

Author Comment

by:toooki
ID: 34980971
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
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 34981068
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
 
LVL 57

Expert Comment

by:giltjr
ID: 34981836
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
 

Author Comment

by:toooki
ID: 34990159
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 57

Expert Comment

by:giltjr
ID: 34991402
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
 

Author Comment

by:toooki
ID: 34999354
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
 
LVL 57

Expert Comment

by:giltjr
ID: 34999553
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
 
LVL 12

Assisted Solution

by:upanwar
upanwar earned 150 total points
ID: 35015245
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
 

Author Comment

by:toooki
ID: 35021305
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
 

Author Comment

by:toooki
ID: 35021312
I do not see any file name: /etc/.kshrc
0
 
LVL 57

Accepted Solution

by:
giltjr earned 150 total points
ID: 35021353
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
 

Author Comment

by:toooki
ID: 35021770
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
 
LVL 57

Expert Comment

by:giltjr
ID: 35024142
Ah, I wonder if somebody has setup an alias for the ls command.  Try issuing the command:

     alias

and see what it shows.
0
 

Author Comment

by:toooki
ID: 35032552
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
 

Author Comment

by:toooki
ID: 35119838
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
 
LVL 57

Expert Comment

by:giltjr
ID: 35121544
Glad you found it.  It's weird that they did not show up on the alias command.
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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