Difference between revisions of "User:Djgreen/Linux Administration"
m |
m |
||
Line 125: | Line 125: | ||
[10:21] <elliot> make sure they run that from the root of their home | [10:21] <elliot> make sure they run that from the root of their home | ||
directory | directory | ||
+ | |||
+ | ==Chinese Fonts== | ||
+ | > 01157197 - any idea about adding the Chinese language pack? Is this just another "yum" install? | ||
+ | |||
+ | I'm not sure. Try this: | ||
+ | |||
+ | /usr/bin/yum install fonts-chinese | ||
+ | |||
+ | And see if it fixes his problem. That package isn't installed by default | ||
+ | in RHEL 5 it seems. It contains Chinese TrueType Fonts which will | ||
+ | hopefully fix the issue. Let me know if that fixes it? If so we might want | ||
+ | |||
+ | to add it to the Eos lab machines. | ||
+ | |||
+ | ==Administrative Scripts== | ||
+ | > How did you go about doing that? I'd like to be able to replicate if you're n ot around. | ||
+ | |||
+ | I've been using realm-crons, which have the option of being | ||
+ | run either every 20 minutes, hour, day, or month. You can | ||
+ | take a look at some of the scripts I've used for random | ||
+ | stuff in: | ||
+ | |||
+ | /afs/bp/system/i386_linux3/athenan/adm.ece | ||
+ | |||
+ | A repository of scripts is in the scripts directory, | ||
+ | while things that actually run are in one of the | ||
+ | cron.* directories. The names are pretty self | ||
+ | explanatory, with the exception of wsr, which is | ||
+ | the 20 minute cron job. | ||
+ | |||
+ | To avoid killing AFS, all crons are setup to have a | ||
+ | random wait before running, with a maximum time of | ||
+ | 20 minutes, so doing things at an EXACT instant is | ||
+ | not generally feasible -- though with a couple of | ||
+ | combos of scripts it could be done -- but its would | ||
+ | be messy. | ||
+ | |||
+ | ==Nvidia and X== | ||
+ | > P.S. Should I just use nVidia's installer, or is it packaged nicely | ||
+ | for | ||
+ | > RHEL 5/Realm Kit somewhere? | ||
+ | |||
+ | Normally the open source nv driver is more stable than the binary only | ||
+ | nvidia. However, RHEL5 isn't exactly new anymore. An updated X driver | ||
+ | would be the thing to try. | ||
+ | |||
+ | livna.org has packages for Fedora. Ah... | ||
+ | |||
+ | http://atrpms.net/dist/el5/ | ||
+ | |||
+ | has the nvidia packages for RHEL 5. | ||
+ | |||
+ | Jack |
Revision as of 12:43, 9 September 2010
Prep Machine for KickStart
- Make sure hostname has config file in /afs/bp/system/config/linux-kickstart/configs/ece
- Make sure host is using PXE-all DHCP template in QIP.
Rename Linux Boxes
If the machine is using dhcp I think you just need to switch in qip and reboot into the new lease / IP / hostname.
If the machine has a static configuration, you need to edit:
/etc/sysconfig/network-scripts/ifcfg-eth0
and
/etc/sysconfig/network
with the new values.
Try editing these files:
/etc/sysconfig/network
and
/etc/hosts
The hostname should be stored there.
After your box is on the network as the new name, run this command as root:
/usr/sbin/rhnreg_ks --force --activationkey <your_key_here>
Where <your_key_here> comes from the "activationkey" line in the web kickstart file. This will create a new "object" in red hat network.
Get Login Logs
in Linux, they have the /var/log/wtmp file but it is a binary file format. So the recommended interface is to use the last command.
last -n 100 will show the last 100 people who logged in.
You can also specify alternate wtmp files like
last -n 100 -f /var/log/wtmp.1
Controlling Access
It is possible to use pts groups to control access to Realm Linux.
cluster <cell> <PTS group>
is what goes in the config file. You can also hand edit /etc/update.conf if you don't want to re-install a box. It should look like this:
users blah XXXXXXXXXXXXXXXXXXXXXXXXXXX root blah XXXXXXXXXXXXXXXXXXXXXXXXXXX cluster> eos itecs-admin:helpdesk
where you replace the pts group with what group you want to use. If there is more than one pts group then you just add more cluster> lines.
Let us know if you need any further information. see also:
Remote Reinstall of Existing RHEL box
(11:45:53 AM) gsgatlin: djgreen: You can edit /boot/grub/grub.conf and change the default boot item to re-install this workstation.
(11:47:56 AM) gsgatlin: it starts numbering at 0 so if re-install is the first item it would be default=0, then you reboot and it starts installing.
Mount an NTFS drive
- yum -y install ntfs-3g
- installs ntfs kernel driver
- If it can't find that package, run rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm to add the EPEL repository as an option for yum
- mount -t ntfs-3g <device> <mount location>
- mounts drive to specified location. if connected by usb, drive will be under /dev/sdc, connected internally should be /dev/sda, though you'll likely have to mount a particular partition, like /dev/sdc2, etc
- the mount location must be an existing folder, so if you want to mount to /mnt/windows, you will have to create that windows folder under /mnt first
- example, mount -t ntfs-3g /dev/sdc2 /mnt, mounts the second partition of a usb ntfs drive under /mnt
- dmesg | tail -##
- gives you the last ## entries from the message buffer. Can use this to figure out if the drive is connected and where.
- cp -vau <source> <destination>
- for copying files off the drive. v is for verbose, a for archive, u for update. The destination must be an existing folder.
- don't know if it will stop if it hits an error
- example: (assuming the drive is mounted to /mnt) cp -vau /mnt/bob /local/backup, copies the bob folder from the drive and anything in it to /local/backup
- for copying files off the drive. v is for verbose, a for archive, u for update. The destination must be an existing folder.
Add users individually
sudo vi /etc/users.local.base
sudo vi /etc/users.local
- add their unity username
Add sudo
sudo su - visudo
- add as "username ALL=(ALL) ALL"
- any sudo users must also have been added to the two users.local files as well
Local Home Dir
[10:14] <djgreen> Micah -- anything I need to know about creating local user home folders (/home/*) in Linux? [10:15] <macolon> Umm... make sure that /home is a symlink to /local/home, aside from that, can't really think of anything. [10:16] <djgreen> how about perms? [10:17] <djgreen> just chown to the user and I'm ok? [10:17] <macolon> mkdir directory; chmod 700 directory; chown username.ncsu directory [10:17] <macolon> Assuming that no one else is supposed to access the dir. [10:18] <macolon> if it chokes on chown username.ncsu directory -- two steps then: chown username dir; chgrp ncsu dir
[11:09] <djgreen> Micah -- is there a way for someone to have /home/userid be set as their "homedir" when they login to a machine? Rather than their regular AFS home dir? [11:11] <macolon> setenv HOME /home/userid in .mycshrc
Repair DotFiles
[10:20] <elliot> /usr/bin/repair_dotfiles.sh will do it for linux [10:21] <elliot> make sure they run that from the root of their home directory
Chinese Fonts
> 01157197 - any idea about adding the Chinese language pack? Is this just another "yum" install?
I'm not sure. Try this:
/usr/bin/yum install fonts-chinese
And see if it fixes his problem. That package isn't installed by default in RHEL 5 it seems. It contains Chinese TrueType Fonts which will hopefully fix the issue. Let me know if that fixes it? If so we might want
to add it to the Eos lab machines.
Administrative Scripts
> How did you go about doing that? I'd like to be able to replicate if you're n ot around.
I've been using realm-crons, which have the option of being run either every 20 minutes, hour, day, or month. You can take a look at some of the scripts I've used for random stuff in:
/afs/bp/system/i386_linux3/athenan/adm.ece
A repository of scripts is in the scripts directory, while things that actually run are in one of the cron.* directories. The names are pretty self explanatory, with the exception of wsr, which is the 20 minute cron job.
To avoid killing AFS, all crons are setup to have a random wait before running, with a maximum time of 20 minutes, so doing things at an EXACT instant is not generally feasible -- though with a couple of combos of scripts it could be done -- but its would be messy.
Nvidia and X
> P.S. Should I just use nVidia's installer, or is it packaged nicely for > RHEL 5/Realm Kit somewhere?
Normally the open source nv driver is more stable than the binary only nvidia. However, RHEL5 isn't exactly new anymore. An updated X driver would be the thing to try.
livna.org has packages for Fedora. Ah...
http://atrpms.net/dist/el5/
has the nvidia packages for RHEL 5.
Jack