LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-24-2006, 08:54 AM   #1
ncg
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Rep: Reputation: 0
connect to IP with different shell


I have a big problem. I changed the deafult shell in /etc/passwd file for root. When I want to connect the the IP with telnet or ssh, it gives no shell error from the system. Is there any possibility for the creating a connecting to system with a different shell? may be with this log on operation with root user i can change etc/passwd file. Or any other idea... Anyone can help me on this?
 
Old 04-24-2006, 09:17 AM   #2
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
just use a live cd - get knoppix or what ever. then you can use vi or something to edit the /etc/passwd file.....
 
Old 04-24-2006, 10:05 AM   #3
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
I think the command to edit the passwd file is vipw, it's some special command to do it. Otherwise, I'm not sure it'll take the changes. You might consider looking into that.
 
Old 04-24-2006, 11:48 AM   #4
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
is the issue that you can't log in or that you don't know how to edit /etc/passwd?
 
Old 04-24-2006, 04:34 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
First of all, and you don't want to hear this now but, you should not log in remotely as root but as unprivileged user.
Furthermore shells are local to the system so there's no way I know you gonna succeed specifying one from remote. If you have any unprivved users in the wheel group, log in, su and use the -s arg and supplying any allowed shell from /etc/shells could do the trick.
 
Old 04-25-2006, 01:01 AM   #6
ncg
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Yes I can't log in. I take this error code after entering the root and password.

No shell
Connection closed by foreign host.

I don't know any other users password. I think the /etc/passwd file same as this one.

root:x:0:0:Super-User:/:/sbin/sh
daemon:x:1:1::/:/sbin/noshell
bin:x:2:2::/usr/bin:/sbin/noshell
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:/sbin/noshell
lp:x:71:8:Line Printer Admin:/usr/spool/lp:/sbin/noshell
uucp:x:5:5:uucp Admin:/usr/lib/uucp:/sbin/noshell
smmsp:x:25:25:SendMail Message Submission Program:/:/sbin/noshell
nobody:x:60001:60001:Nobody:/:/sbin/noshell
noaccess:x:60002:60002:No Access User:/:/sbin/noshell
backup:x:510:1:Account for batch backup jobs:/backup:/bin/sh
pocuser:x:311:311::/opt/home/pocuser:/bin/ksh
db2udf1:x:202:202::/opt/home/db2udf1:/bin/ksh
mqm:x:301:301::/opt/mqm:/bin/sh
emcuser:x:7001:701:EMC Main User:/opt/home/pocuser/emc:/bin/ksh
 
Old 04-25-2006, 01:56 AM   #7
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
well, the fact that you don't know another user name is a problem. as you could ssh as another user and do "su", which would allow you to edit /etc/passwd.

I guess a remote ssh command wouldn't work either. But you might try it:

ssh <remote host> chsh -s <path to shell> root

if that makes sense.....

is it a host you cannot get to physically?
 
Old 04-25-2006, 07:52 AM   #8
ncg
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I try the command it doesn't make any sense...
I take this error code:

root@<hostip>'s password:
Permission denied, please try again.

The root password can not be used here. I can't log in.
Is there any possibility for copying same etc/passwd file to this ip.

And I have same users in other system exacly doing the same operation for this system. Is there any possibility for finding any users password in this system?
 
Old 04-25-2006, 08:00 AM   #9
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
This isn't some covert attempt to crack/comprimise this system is it?

You won't answer my question about whether you have physical access.......
 
Old 04-25-2006, 08:46 AM   #10
ncg
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I'm very sorry. I didn't see the question because of my confusion.

No I don't have any physical access.
 
Old 04-26-2006, 12:24 AM   #11
ncg
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Physical access

I find a physical access for the system. I hope this should solve my problem. I'm going crazy
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 06:29 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
ssh connect back shell? tubbay Linux - General 1 06-14-2004 12:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration