Friday, February 4, 2011

apt-get in Linux

I installed the rpmforge (rpmforge-release-0.5.2-2.el5.rf.i386.rpm) from the DAG this link
When I use #apt-get update , it displayed an error saying that "Unable to resolve the dns name apt.sw.be"
The reason is ..I didnt update my /etc/resolv.conf with my DNS servers. After adding the DNS server IP address the problem is solved.

rsh login problem in linux



I have RHEL4 machine with IP address 10.121.113.92 and I want not able to connect to that server using rsh. Below are the steps followed by me to enable the rsh

[root@linux ~]# telnet 10.121.113.92 544
Trying 10.121.113.92...
telnet: connect to address 10.121.113.92: Connection refused
telnet: Unable to connect to remote host: Connection refused
=========================

In the file /etc/xinetd.d/rsh  make disable =no 

[root@linux ~]# more /etc/xinetd.d/rsh
 default: on
# description: The rshd server is the server for the rcmd(3) routine and, \
#       consequently, for the rsh(1) program.  The server provides \
#       remote execution facilities with authentication based on \
#       privileged port numbers from trusted hosts.
service shell
{
        disable = no
        socket_type             = stream
        wait                    = no
        user                    = root
        log_on_success          += USERID
        log_on_failure          += USERID
        server                  = /usr/sbin/in.rshd
}
====================================
In the file /etc/xinetd.d/rlogin  make disable =no 

[root@linux ~]# more /etc/xinetd.d/rlogin
# default: on
# description: rlogind is the server for the rlogin(1) program.  The server \
#       provides a remote login facility with authentication based on \
#       privileged port numbers from trusted hosts.
service login
{
        disable = no
        socket_type             = stream
        wait                    = no
        user                    = root
        log_on_success          += USERID
        log_on_failure          += USERID
        server                  = /usr/sbin/in.rlogind
}

=============
I then opened the /etc/pam.d/rlogin file and commented the "password " line and "auth       required    pam_securetty.so" line
Next I modified the line "auth required pam_rhosts_auth.so" to "auth sufficient pam_rhosts_auth.so"

[root@linux ~]# more /etc/pam.d/rlogin
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rlogin" must be
# listed in /etc/securetty.
auth       required     pam_nologin.so
#auth       required    pam_securetty.so
auth       required     pam_env.so
auth       sufficient   pam_rhosts_auth.so
auth       required     pam_stack.so service=system-auth
account    required     pam_stack.so service=system-auth
#password   required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth


==========================
Commented "auth       required    pam_securetty.so" line in the /etc/pam.d/rsh file


[root@linux ~]# more /etc/pam.d/rsh
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rsh" must be
# listed in /etc/securetty.
auth       required     pam_nologin.so
#auth       required    pam_securetty.so
auth       required     pam_env.so
auth       sufficient   pam_rhosts_auth.so
account    required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth

==============

[root@linux ~]# more /etc/pam.d/rexec
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rexec" must be
# listed in /etc/securetty.
auth       required     pam_nologin.so
auth       required     pam_securetty.so
auth       required     pam_env.so
auth       required     pam_stack.so service=system-auth
account    required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth

===================

Added rsh,rlogin,rexec to /etc/securetty

[root@linux ~]# more /etc/securetty
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
rsh
rlogin
rexec
=====================

Created the /root/.rhosts file with 644 permission and added the host name/IP address from which this server will be rsh connected

[root@linux ~]# more /root/.rhosts
10.121.113.95
first.test.com

================

[root@linux ~]# hostname
linux.test.com
==========

[root@linux ~]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1         localhost.localdomain   localhost
10.121.113.92   linux.test.com
10.121.113.94   first.test.com
10.121.113.95   second.test.com

==============

restarted the xinetd services

[root@linux ~]# chkconfig --list | grep rsh
        rsh:    on
[root@linux ~]# chkconfig --list | grep rlogin
        rlogin: on
===============


Online Prepaid Recharge --India

Thursday, February 3, 2011

Passwordless SSH between Solaris & Linux

The steps to be done for passwordless SSH

 $cd /home/user/.ssh    
$ssh-keygen -t rsa
$cat id_rsa.pub | ssh user@remotemachine "cat - >> .ssh/authorized_keys"
$ssh root@remotemachine

If you try to SSH theserver from remote machine and its not working, then check the permissions on the user's home directory.The permissions must be
  755 for home directory 
  700 for /home/user/.ssh
  644 for /home/user/.ssh/<all files>

Tuesday, October 12, 2010

Solaris eeprom command

eeprom ( Electrically Erasable Programmable Read Only Memory)

Brief description about EEPROM device:
                      It is a non-volatile storage device that cab be rewritten and erased by an electrical charge , one byte at a time whereas RAM or Flash Drives can do that in blocks.EEPROM can store information even when the power is turned off whereas RAM wipes the data.EEPROM is slower that RAM , but is perfectly fine for applications such as storing saved BIOS settings.

Now coming to the eeprom command
eeprom can be used to change the NVRAM parameters while the Solairs OS is running
eeprom comand is located in /usr/sbin/eeprom

[root@] / # eeprom
test-args: data not available.
diag-passes=1
pci-probe-list=c,8,d,5,13
local-mac-address?=false
fcode-debug?=false
silent-mode?=false
scsi-initiator-id=7
oem-logo: data not available.
oem-logo?=false
oem-banner: data not available.
oem-banner?=false
ansi-terminal?=true
screen-#columns=80
screen-#rows=34
ttyb-rts-dtr-off=false
ttyb-ignore-cd=true
ttya-rts-dtr-off=false
ttya-ignore-cd=true
ttyb-mode=9600,8,n,1,-
ttya-mode=9600,8,n,1,-
output-device=screen
input-device=keyboard
load-base=16384
auto-boot?=true
boot-command=boot
diag-file: data not available.
diag-device=disk net
boot-file: data not available.
boot-device=disk
use-nvramrc?=false
nvramrc: data not available.
security-mode=none
security-password: data not available.
security-#badlogins=0
diag-script=none
diag-level=max
diag-switch?=false
error-reset-recovery=boot

To list a single parameter you can use eeprom <parameter>
[root@] / # eeprom boot-device
boot-device=disk

To change the value of default boot device to disk2 ,perform the command
eeprom <parameter>=<new-value>
[root@] / # eeprom boot-device=disk2
[root@] / # eeprom boot-device
boot-device=disk2