Can not echo my server1

Discussion in 'Server Operation' started by diamondmix, Jan 9, 2009.

  1. diamondmix

    diamondmix New Member

    I am following Howto forge The Perfect Server - Ubuntu Intrepid Ibex (Ubuntu 8.10) But every time when I reach the part where you have to edit your /etc/hosts
    127.0.0.1 localhost.localdomain localhost
    192.168.0.100 server1.example.com server1

    # The following lines are desirable for IPv6 capable hosts
    ::1 localhost ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts

    my setup is
    127.0.0.1 local
    127.0.0.1 server1.flowtrinidad.com sever1
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    My isp is listed in the /eyc/hosts file
    when I change it according to the Howtoforge setup and run
    echo server1.example.com > /etc/hostname
    I get this (-bash: /etc/hostname: Permission denied
    I have tried changing the configuration in the /etc/hosts file without any results by re-installing the server several times but without any results. Can you please help me and tell me what I am doing wrong. I want to get away from Microsoft and its products. I am a newbie and have been struggling with the server installation for quite along time.
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Did you run this with root parmissions?
    What's the output of
    Code:
    ifconfig
    ?
     
  3. marpada

    marpada New Member

    Are you sure are you doing this as root? Try

    Code:
    sudo echo server1.example.com >> /etc/hostname
    Besides, ">" with erase the existing file content, you should try ">>" to append.

    I suggest you that if you are new to Linux first use a editor (vim, nano, etc).
    ________
    Hardcore fingering
     
    Last edited: Mar 30, 2011
  4. falko

    falko Super Moderator ISPConfig Developer

    But then you'd have two or more hostnames in /etc/hostname. Therefore, you should use ">".
     
  5. diamondmix

    diamondmix New Member

    Yes I am in root but still getting the same results.When I use hostname the results is=server1 ..and Hostname -f= server1.example.com the results is fine also. But the ..Sudo echo server1.example.com > /etc/hostname the same results. Even if I input >> same thing
     
  6. diamondmix

    diamondmix New Member

    ifconfig

    Tis is the output of the :-ifconfig

    [email protected]:~$ ifconfig
    eth0 Link encap:Ethernet HWaddr 00:e0:4d:a3:95:5b
    inet addr:192.168.73.100 Bcast:192.168.73.255 Mask:255.255.255.0
    inet6 addr: fe80::2e0:4dff:fea3:955b/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:27 errors:0 dropped:0 overruns:0 frame:0
    TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:8762 (8.7 KB) TX bytes:5841 (5.8 KB)
    Interrupt:252 Base address:0x4000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:36 errors:0 dropped:0 overruns:0 frame:0
    TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:2598 (2.5 KB) TX bytes:2598 (2.5 KB)

    [email protected]:~$ sudo echo server1.example.com > /etc/hostname
    bash: /etc/hostname: Permission denied
    [email protected]:~$
     
  7. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    ls -l /etc/hostname
    ?
     
  8. diamondmix

    diamondmix New Member

    Access Denied

    ls -l /etc/hostname
    -rw-r--r-- 1 root root 8 2009-01-08 18:42 /etc/hostname
    This is the results I got. Wish I was a linux whiz like you falko...
    Thanks for the ongoing help
     
  9. falko

    falko Super Moderator ISPConfig Developer

    Looks good.
    Can you try this?
    Become root by typing
    Code:
    sudo su
    And afterwards run
    Code:
    echo server1.example.com > /etc/hostname
     
  10. diamondmix

    diamondmix New Member

    su:Authentication failure

    When I tried su I am getting this:-

    [email protected]:~$ su
    Password:
    Your account has expired; please contact your system administrator
    su: Authentication failure
    any help
     
  11. falko

    falko Super Moderator ISPConfig Developer

Share This Page