Help I'm Stuck
 
 Root Problems

No Shell For root
Can't login as root
Can telnet but not ftp

Telnet/Ftp Problems

Adding a banner
Anonymous ftp
 


CDE Questions

 
 
 

  Home

  No Shell For Root

One of the most common problems users request assistance for is the loss of root access shortly after making changes to the roots default shell.  Users like to manually change the shell of account root to their shell of choice. The easiest mistake to make is to change the default shell "/sbin/sh" to "/sbin/ksh". The next time you try to login in as root you will out that you are unable to log on as root because there is "No shell". The only way to fix the problem is to change root shell from /sbin/ksh to /usr/bin/ksh in /etc/passwd. Since the /etc/passwd is owned by root and you can not log on as root any more, how do you solve the problem ?

The problem is caused because the user does not know there are no other shells but Bourne Shell in /sbin. Therefore the system can not find /sbin/ksh and you fail to log on the root because of "No shell". /sbin/sh is a hard copy under root (/) file system to make the system usable even before the file system /usr is mounted.

Boot the System using the Solaris CD and Installation Boot Disk:

Insert the Solaris x86 CDROM in the drive
Boot with the installation diskette (or correct Driver Update Boot diskettes)

Boot from CDROM:

Select the cdrom to boot when presented with the available devices

[  ] Disk: Target 0
[x] CD  : Target 0

Press the <F2> key to continue.

Boot to Single user mode from CD:

When asked to select Interactive or Jumpstart installation type the following:

Select type of installation: boot -s

Press the <enter> key to continue.

Note:  You have approxiamately 30 seconds to make this decision before the system boots into interactive installation.

Mount the root drive:

# mount /dev/dsk/cxdxsx /a        # for IDE drives, replace x with value that reflects your drive

or

# mount /dev/cxtxdxsx /a            # for SCSI drives, replace x with value that reflects your drive

Set your terminal mode for editing:

# TERM=at386;export TERM

Edit the passwd file and correct the path to the shell account:


# vi /a/etc/passwd

Line looks like:

root:x:0:1:Super-User:/:/sbin/ksh

When completed should look like:

root:x:0:1:Super-User:/:/usr/bin/ksh

Exit vi and save the passwd file:

:wq!

Un-mount the partition and reboot system:

# cd /
# umount /a
# init 6

Top


Can't Login As Root From A Remote Terminal ?

When trying to login to the Solaris server by Super-user account via the networking, getting: "Not on system console" and "Connection closed by foreign host" messages, then was expelled from the system.

Modify the login file, must be logged on as root:

# vi /etc/default/login

Comment out the /dev/console line:

Looks like:

~ CONSOLE=/dev/console

Should look like:

~# CONSOLE=/dev/console

Exit vi and save the file:

:wq!

Top


I Can Telnet To A Box As Root, But Not ftp As Root

The following error message is returned: 

'530 Login incorrect. Login failed.'. 

Ftp for users other than root work just fine.

An automatic security auditing program created a /etc/ftpusers file, with root as the single entry. Removing root from /etc/ftpusers solves the problem.

Modify the /etc/ftpusers file, must be logged on as root:

# vi /etc/ftpusers

Comment out the root entry:

Looks like:

root

Should look like:

# root

Exit vi and save the file:

:wq!

Top


How to add a Banner to a Solaris telnet Login

In Solaris versions 2.4 and higher, you can add a banner by utilizing the /etc/issue file. Edit this file to contain your banner, and it will be read and displayed before the login prompt.

Edit the /etc/issue file and add your desired banner:

# vi /etc/issue

> This server is for company use only, violators will be prosecuted!

Exit vi and save file:

:wq!

Test your new banner:

# telnet localhost

The telnet session should look like this:

SunOS 5.7

This server is for company use only, violators will be prosecuted!

login:

This functionality is available in versions of Solaris later than 2.4.  It is always recommended to setup a file that informs users what your site is for and state some rules of conduct.

Top


How do I Set Up Anonymous FTP?

First, add the following entry to the /etc/passwd file:

# su root
# vi /etc/password
ftp:x:30000:30000:Anonymous FTP:/export/ftp:/nosuchshell

Exit vi and save the file:

:wq!

Add the following entry to /etc/shadow:

# su root
# vi /etc/shadow
ftp:NP:6445::::::

Exit vi and save the file:

:wq!

Finally, cut and paste the following script, and run it on the machine that you are setting up as an anonymous FTP server:

makeftp

This script creates ~ftp/pub with 777 (world-write) permissions. If you prefer more secure permissions, execute a new chmod on ~ftp/pub after running this script.

Top