- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Disable Copyright text when using command su -
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 10:53 PM
07-02-2008 10:53 PM
Does anyone know how i can disable the copyright text that appears when i use the command su - ?
The text i mean is this one:
(c)Copyright 1983-2003 Hewlett-Packard Development Company, L.P.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-2000 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2003 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.
Hewlett-Packard Company
3000 Hanover Street
Palo Alto, CA 94304 U.S.A.
Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
Value of TERM has been set to "xterm".
WARNING: YOU ARE SUPERUSER !!
Br
Patrik
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 11:00 PM
07-02-2008 11:00 PM
Re: Disable Copyright text when using command su -
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1230173
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 11:12 PM
07-02-2008 11:12 PM
Re: Disable Copyright text when using command su -
Thank you for the link to the other post. I did search but did not find it.
I know now that it is illegal to remove this copyright notice. But i think it is a stupid way to show it. When using su - command i scripts, the log starts filling up with these messages: ttytype: couldn't open /dev/tty for reading
stty: : Not a typewriter
Followed by the whole copyright text.
Br
Patrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 11:17 PM
07-02-2008 11:17 PM
Re: Disable Copyright text when using command su -
Its perfectly legal to have it like below.
1. Copy the file /etc/copyright to /etc/copyright.txt
2. Modify the file /etc/copyright to contain the following text (only): This server software is copyright (C) HP and others. To view the entire copyright notice, use cat /etc/copyright.txt
This will save large text for you...
This was verified with the HP legal department and confirmed it
complies with the legal requirement. If you have access to KB's, there is a doc for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2008 04:36 AM
07-04-2008 04:36 AM
Re: Disable Copyright text when using command su -
does adding this to /etc/profile help ?
(make a copy sign on in two places to test etc. )
It should only display it if is on a proper pty
tty -s
if [ $? = 0 ]
then
cat /etc/copyright
fi
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2008 05:32 AM
07-04-2008 05:32 AM
Re: Disable Copyright text when using command su -
I do not understand what this thing does:
tty -s
if [ $? = 0 ]
then
cat /etc/copyright
fi
If i run a script in crontab, it will not show copyright info?
Br
Patrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2008 05:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2008 06:02 AM
07-04-2008 06:02 AM
Re: Disable Copyright text when using command su -
The tty command prints the name of the terminal device you are connected to.
It gives a return code of 0 if it is a terminal.
If it is not you get a return code of 1, and a 2 if there is some error.
So the code checks if you are on a terminal and then prints the notice otherwise it does not bother .
The -s option supresses the terminal name output so that you can use it in a test without getting any output.
$? is the standard environment variable for the return code of the last command.
See man tty for details.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2008 12:20 PM
07-04-2008 12:20 PM
Re: Disable Copyright text when using command su -
The proper syntax is: if [ $? -eq 0 ]
That way it does integer comparisons.
You can also skip tty(1) and just use: if [ -t ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2008 12:57 PM
07-04-2008 12:57 PM
Re: Disable Copyright text when using command su -
This message and the copyright message are designed only to be read by people. As mentioned before, you must protect your login profiles, both /etc/profile and $HOME/.profile. A script, whether in cron or batch is not connected to a terminal and therefore, no human is there to read or respond to any messages. You must gather *ALL* the terminal commands including the copyright message (and the /etc/motd message if used) into a single part of your profiles, then run these commands when a real terminal exists. Examples of terminal-only commands:
ttytype
tset
tput
stty
tabs
and anything that is designed for humans to read such as:
cat /etc/copyright
cat /etc/motd
I am not a lawyer, but I believe that it is not illegal to bypass this /etc/copyright as long as you see the message when the system first starts up, something like the first pages of a book. Another method is to use the notice given in many books and documents, something like this:
print "To read the copyright statement"
print "type this command: cat /etc/copyright"
But much more important than the copyright message is proper execution of the su - command in cron or batch -- do not run any terminal-only commands under these circumstances.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2008 05:48 AM
07-05-2008 05:48 AM
Re: Disable Copyright text when using command su -
su - user -c "..."
Has no place in scripts at all. This instantly places a dependency in the script on the contents of /etc/profile and probably the users .profile, plus .kshrc or .cshrc if other shells are the default shell for a specific user. Thats not good as you don't always know what some other user is going to do with his startup script (for example some people put interactive menus in their login script).
If you need some env variables setting when calling a command as another user, its much better to explicitly set them first and then call su without the "-" which sources the users own environment. So for example a routine to start an Oracle database might go from the dangerous:
su - oracle -c "/usr/local/bin/dbstart"
Which calls everything in /etc/profile and ~oracle/.profile regardless of whether I want or need it, to the much safer and more reliable:
ORACLE_SID=mydb
ORACLE_HOME=/oracle/10.2
PATH=${PATH}:${ORACLE_HOME}/bin
su oracle -c "/usr/local/bin/dbstart"
Which only has the env variables set I know I need to start Oracle.
HTH
Duncan
I am an HPE Employee
