- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Add a string at the end of a specific line
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
Discussions
Discussions
Forums
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
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
тАО05-18-2004 07:34 AM
тАО05-18-2004 07:34 AM
sshd::102:
The reason I like to do it to over 20 servers and I like just to remsh and use ksh to handle it, How can I do that ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 07:35 AM
тАО05-18-2004 07:35 AM
Re: Add a string at the end of a specific line
should do it.
HTH
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 07:39 AM
тАО05-18-2004 07:39 AM
Solutioncmnd="sed -e 1,$s/sshd::102:/sshd::102:sys/ /etc/group > /tmp/dummy; cat /tmp/dummy > /etc/group"
then
remsh server_name $cmnd
HTH
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 07:39 AM
тАО05-18-2004 07:39 AM
Re: Add a string at the end of a specific line
It's better to use user|groupmod commands to interface the passwd and group files than editing them manually.
I would run the command
usermod -G 102 sys
This should add sys to sshd group in /etc/group.
Use remsh to run this command on all the servers.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 07:40 AM
тАО05-18-2004 07:40 AM
Re: Add a string at the end of a specific line
perl -pe '/^ssh/ && s/$/sys/' /etc/group
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 07:40 AM
тАО05-18-2004 07:40 AM
Re: Add a string at the end of a specific line
sshd::102:sys
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 07:50 AM
тАО05-18-2004 07:50 AM
Re: Add a string at the end of a specific line
ex -s +'1,$ s/^ssh::102:$/&sys/ | wq!' /etc/group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 07:57 AM
тАО05-18-2004 07:57 AM
Re: Add a string at the end of a specific line
Thanks a lot...