Skip to content

Posts from the ‘Linux’ Category

Change hostname in OEL 7

Method 1 :  nmtui  tool on terminal

Method 2 : [root@EDB-LEB-4-53 ~]# hostnamectl status
Static hostname: EDB-LEB-4-53.ace-ins.com
Icon name: computer-vm
Chassis: vm
Machine ID: 11cc4d26c75c476db3fa89a66a0fcae9
Boot ID: afc4b181973e40b9ab46ca774e6130c4
Virtualization: vmware
Operating System: Oracle Linux Server 7.0
CPE OS Name: cpe:/o:oracle:oracle_linux:7.0:GA:server
Kernel: Linux 3.8.13-35.3.1.el7uek.x86_64
Architecture: x86_64

 

[root@EDB-LEB-4-53 ~]# hostnamectl set-hostname ezylebuatdb.damana.com
[root@EDB-LEB-4-53 ~]# hostnamectl status
Static hostname: ezylebuatdb.damana.com
Icon name: computer-vm
Chassis: vm
Machine ID: 11cc4d26c75c476db3fa89a66a0fcae9
Boot ID: afc4b181973e40b9ab46ca774e6130c4
Virtualization: vmware
Operating System: Oracle Linux Server 7.0
CPE OS Name: cpe:/o:oracle:oracle_linux:7.0:GA:server
Kernel: Linux 3.8.13-35.3.1.el7uek.x86_64
Architecture: x86_64

 

Diagnostic-Code: SMTP; 550 host unknown

When we’re trying to send mail to localdomain through mailx from linux box. It says “Diagnostic-Code: SMTP; 550 host unknown”  and mail not sent.

Solution :

Edit sendmail.cf

# “Smart” relay host (may be null)
DS[10.x.x.xx]

restart the sendmail service and send the mail is successful

10.x.x.xx — mailbox server

 

 

 

 

delete argument too long linux

When you’re trying to delete files in linux , you receive following error message

bash: /bin/rm: Argument list too long

Solution :

go to that directory and execute below command

find . -name ‘filename*’ -print0 | xargs  -0 rm

vncserver configuration

Step 1:  Login as root user

Install vncserver rpm package, check whether its already installed or not

vnc-server-4.1.2-14.el5_5.4.x86_64.rpm

[root@ebsdev ~]# rpm -q vnc-server-4.1.2-14.el5_5.4.x86_64
vnc-server-4.1.2-14.el5_5.4
[root@ebsdev ~]#

Step 2: password for vncserver

[root@ebsdev ~]# vncpasswd
Password:
Verify:
[root@ebsdev ~]#

Step 3:

[root@ebsdev ~]# vncserver
xauth: creating new authority file /root/.Xauthority

New ‘ebsdev.ace-ins.com:1 (root)’ desktop is ebsdev.ace-ins.com:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ebsdev.ace-ins.com:1.log

Step 4:

[root@ebsdev ~]# vi .vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ –x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ –r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &

remove the command from unset and exec

[root@ebsdev ~]# vi .vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ –x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ –r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &

Step 5:

[root@ebsdev ~]# vncserver -kill :1
Killing Xvnc process ID 20106
[root@ebsdev ~]#

Step 6:

[root@ebsdev ~]# vncserver

New ‘ebsdev.ace-ins.com:1 (root)’ desktop is ebsdev.ace-ins.com:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ebsdev.ace-ins.com:1.log

[root@ebsdev ~]#

Step 7: Download vncviewer

http://www.realvnc.com/download/viewer/

Step 8:  connect the host with vncviewer

Note : Some times you cann’t able connect your host, in this case check your firewall of linux and If already vncserver process aviable, kill the session using by vncserver -kill :1 

If you want to connect the server which was installed on RHEL 7, you just install “tigervnc-server-1.8.0-5.el7.x86_64.rpm” and then start vncserver & you can able to connect the server using vncviewer from your pc.

 

bip_11

 

bip_12

 

bip_13

oops i cann’t boot my windows because of before linux was installed on my machine

Steps below

  1. Before removing a partition, boot rescue mode
  2. Start parted ,where /dev/hda is the device on which to remove the partition
  3. In command mode
  4. >list hard-drives
  5. >parted /dev/hda or /dev/sda
  6. >print
  7. >rm 2
  8. exit and then you can install another OS on your system like windows xp or any.

step by step redhat installation on vmware

This document show you step by step redhat installation on vmware workstation

 

Step by step redhat installation on VMware workstation

insufficent disk space you need more space on the following file systems: 167m on /mnt/sysimage/usr

While you’re trying to install Linux, you may face this issue

”  there was an error running your transaction for the following reasons insufficent disk space

you need more space on the following file systems: 167m on /mnt/sysimage/usr “

redhat_40

Solution : Increase the /usr partition size, you might be given a very less size while you’re done partition. Increase the size at least 5GB for /usr

How do i set linux file permissions using symbolic mode

If you want to set the file permissions in Linux, you can get a two options to set the appropriate permissions of files. One is Symbolic method and Numeric method. Here you can read about symbolic method examples.

The chmod (change mode) command will useful to change your file permissions. First of all I want to explain about how do i set appropriate file permissions for user, groups and others. Here others means Everybody (users) can able to view the files or ability to change the file contents if you give permissions.

The basically Linux file is 9 rightmost bits in 10bits permissions block.

Example :

rw-rw-rw- 1 root   root       889 Nov 10 10:59 1millions.txt

Which user :

u  --> user

g  --> groups

o  --> others

a   --> all

What to do ?

+   --> add this permission

-  --> remove this permission

= --> set exactly this permission

Which permissions :

r  --> read

w   --> write

x  ---> execute

Let’s see some examples :
Example 1: Set read write permission of this files for all

[root@siebelts u01]# chmod a=rw 1millions.txt

[root@siebelts u01]# ls -l 1millions.txt
-rw-rw-rw- 1 root root 889 Nov 10 10:59 1millions.txt

Example 2: Want to remove write permission for all users

[root@siebelts u01]# chmod a-w 1millions.txt
[root@siebelts u01]# ls -l 1millions.txt
-r--r--r-- 1 root root 889 Nov 10 10:59 1millions.txt
[root@siebelts u01]#

Example 3: Set the write permission for owner of this file

[root@siebelts u01]# chmod u+w 1millions.txt
[root@siebelts u01]# ls -l 1millions.txt
-rw-r--r-- 1 root root 889 Nov 10 10:59 1millions.txt

Example 4: set write and execute permission for groups

[root@siebelts u01]# chmod g+wx 1millions.txt
[root@siebelts u01]# ls -l 1millions.txt
-rw-rwxr-- 1 root root 889 Nov 10 10:59 1millions.txt
[root@siebelts u01]#

Example 5: set read and write  permission for other user also

[root@siebelts u01]# chmod o+rw 1millions.txt
[root@siebelts u01]# ls -l 1millions.txt
-rw-rwxrw- 1 root root 889 Nov 10 10:59 1millions.txt
[root@siebelts u01]#

Example 6 : remove the write, execute permission of  groups and others

[root@siebelts u01]# chmod g-rw 1millions.txt && chmod o-rw 1millions.txt
[root@siebelts u01]# ls -l 1millions.txt
-rw---x--- 1 root root 889 Nov 10 10:59 1millions.txt

Example 7: Let’s see i change the groups of this file and try to write on this file.

[root@siebelts u01]# chown :oinstall 1millions.txt
[root@siebelts u01]# ls -l 1millions.txt
-rw---x--- 1 root oinstall 889 Nov 10 10:59 1millions.txt
[root@siebelts u01]# su - oracle
[oracle@siebelts ~]$ vi /u01/1millions.txt

"/u01/1millions.txt" [Permission Denied]
[oracle@siebelts ~]$

Example 8: set write permission of this file and try to write using member of the oinstall group

[root@siebelts u01]# chmod g+rw 1millions.txt
[root@siebelts u01]# ls -l 1millions.txt
-rw-rw---- 1 root oinstall 32 Nov 11 04:25 1millions.txt

[root@siebelts u01]# cat 1millions.txt
File permission symbolic test
[root@siebelts u01]# su - oracle

[oracle@siebelts ~]$ cd /u01
[oracle@siebelts u01]$ vi 1millions.txt
[oracle@siebelts u01]$ cat 1millions.txt
File permission symbolic test
File can be write and read by member of oinstall
[oracle@siebelts u01]$

Reference : Tuxfiles Linux File permissions

Linux How do i view top two lines of files


[oracle@siebelts ~]$ head -n 2 /u01/app/oracle/diag/rdbms/crmtest/crmtest/trace/alert_crmtest.log
Wed Dec 07 04:46:19 2011
Starting ORACLE instance (normal)