06-26-2002
Re: rcp and .rhosts for secure env
Quote:
Originally posted by Kelam_Magnus
You must be in a trusted mode for this to be secure!!!
I take off my aluminum hat for nobody!
I have gotten a lot of good use out of SSH and my network here at the house. Under Win32 I use pscp for copying stuff back and forth a lot and putty for console access. I also use putty to open secure shell tunnels for access to the proxy server under OpenBSD. Works like a charm!
Kelam, do you ever attend the DFWUUG that take place in Dallas? I should since they meet at my work location but it seems that my classes always fall on Tuesday and Thursday so I can't get to the DFWUUG or the Perlmonger meetings. I think it is a consipiracy (hence the need for the aluminum hat).
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
My oracle database is generating archive logs. I want to copy those archive logs over to backup server on a regular basis. I know how to create an ftp job and I can put it in my crontab. My problem is that I don't know how to send the files just once instead of sends all the files in the... (4 Replies)
Discussion started by: Alan Bird
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I'm an intern at a business that just acquired a company that ran off the unix system. They have files on this workstation that they would like to move to a windows XP pro system, but no one (myself included) has enough unix knowledge to know how to do this. It's my understanding that this can... (8 Replies)
Discussion started by: intern
8 Replies
3. Shell Programming and Scripting
I'm in the process of writing a shell script with copies files from one linux box to another using scp. I wish to run this through a cronjob so it cannot be interactive.
This is what I have so far.
#!/bin/sh
PASSWD='passswd'
dateset=$( date | awk '{print $2 $3 $6}')
for dates in $dateset;... (1 Reply)
Discussion started by: tcruicksh
1 Replies
4. Shell Programming and Scripting
Hello All,
we have scenarion where we need to pull the Files from Windows to Unix Box through SFTP protocol. as per our analysis we did install the cygwin package on the Windows Box to have the openSSH package functionality.
1.Will openSSH help us to achieve the functionality what we are... (3 Replies)
Discussion started by: Amey Joshi
3 Replies
5. Shell Programming and Scripting
Hi I want to transfer all files in a folder to another folder. So the files have a ending of .lop.txt
thanks (4 Replies)
Discussion started by: gisele_l
4 Replies
6. UNIX for Advanced & Expert Users
HI Experts,
I have following code to FTP all pdf files from remote (win sever) to Linux box.
function LsFiles(){
ftp -n -i -v $HT <<end_ftp
user $USR $PASSWD
cd $DIRNAME
ls "-lrt *.pdf"
bye
end_ftp
}
LsFiles > list_of_files.txt
function getFiles(){
ftp -n -i -v $HT <<end_ftp... (2 Replies)
Discussion started by: dipeshvshah
2 Replies
7. Shell Programming and Scripting
Hi,
I am new to shell scripting,and i was planning to write a script that will FTP files to destination folder.
All configuration should be done through a properties files.I was planning that All configuration should be done
through a properties files. and finally the output should be... (0 Replies)
Discussion started by: rahul125
0 Replies
8. Shell Programming and Scripting
I have to write script in which I have to copy files from different directories on machine A and put them in corresponding directories in machine B.
Here machine A remains same per project and machine B keeps on changing.
Is there any way through which I can do this using single remote... (1 Reply)
Discussion started by: madhurjajoo
1 Replies
9. UNIX for Advanced & Expert Users
Hi Am using unix Ksh
Am getting the problem while transferring zero size files through the script .
When i transfer zero size files from local machine to remote machine manually i can able to do it .
My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies
10. Linux
Hi,
I have to transfer my files using FTP. Few files are in Zipped format (.Z) and few are in .PX format . For zipped files, we need to change the mode to binary while transferring the files whereas for the px files the mode should be ascii.
Eg: sample1.z
sample2.z
sample3.z
sample.px ... (2 Replies)
Discussion started by: vidlaks
2 Replies
LEARN ABOUT CENTOS
change_hat
AA_CHANGE_HAT(2) AppArmor AA_CHANGE_HAT(2)
NAME
aa_change_hat - change to or from a "hat" within a AppArmor profile
SYNOPSIS
#include <sys/apparmor.h>
int aa_change_hat (char *subprofile, unsigned long magic_token);
Link with -lapparmor when compiling.
DESCRIPTION
An AppArmor profile applies to an executable program; if a portion of the program needs different access permissions than other portions,
the program can "change hats" to a different role, also known as a subprofile. To change into a new hat, it calls the aa_change_hat()
function to do so. It passes in a pointer to the subprofile which it wants to change into, and a 64bit magic_token. The magic_token is
used to return out of the subprofile at a later time.
If a program wants to return out of the current subprofile to the original profile, it calls aa_change_hat() with a pointer to NULL as the
subprofile, and the original magic_token value. If the magic_token does not match the original magic_token passed into the kernel when the
program entered the subprofile, the change back to the original profile will not happen, and the current task will be killed. If the
magic_token matches the original token, then the process will change back to the original profile.
If the program wants to change to a subprofile that it can never change back out of, the application should call aa_change_hat() with a
magic_token of 0.
As both read(2) and write(2) are mediated, a file must be listed in a subprofile definition if the file is to be accessed while the process
is in a "hat".
RETURN VALUE
On success zero is returned. On error, -1 is returned, and errno(3) is set appropriately.
ERRORS
EINVAL
The apparmor kernel module is not loaded or the communication via the /proc/*/attr/current file did not conform to protocol.
ENOMEM
Insufficient kernel memory was available.
EPERM
The calling application is not confined by apparmor.
ECHILD
The application's profile has no hats defined for it.
EACCES
The specified subprofile does not exist in this profile or the process tried to change another process's domain.
EXAMPLE
The following code examples shows simple, if contrived, uses of aa_change_hat(); a typical use of aa_change_hat() will separate privileged
portions of a process from unprivileged portions of a process, such as keeping unauthenticated network traffic handling separate from
authenticated network traffic handling in OpenSSH or executing user-supplied CGI scripts in apache.
The use of random(3) is simply illustrative. Use of /dev/urandom is recommended.
First, a simple high-level overview of aa_change_hat() use:
void foo (void) {
unsigned long magic_token;
/* get a random magic token value
from our huge entropy pool */
magic_token = random_function();
/* change into the subprofile while
* we do stuff we don't trust */
aa_change_hat("stuff_we_dont_trust", magic_token);
/* Go do stuff we don't trust -- this is all
* done in *this* process space, no separate
* fork()/exec()'s are done. */
interpret_perl_stuff(stuff_from_user);
/* now change back to our original profile */
aa_change_hat(NULL, magic_token);
}
Second, an example to show that files not listed in a subprofile ("hat") aren't accessible after an aa_change_hat() call:
#include <stdlib.h>
#include <string.h>
#include <sys/apparmor.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int fd;
unsigned long tok;
char buf[10];
/* random() is a poor choice */
tok = random();
/* open /etc/passwd outside of any hat */
if ((fd=open("/etc/passwd", O_RDONLY)) < 0)
perror("Failure opening /etc/passwd");
/* confirm for ourselves that we can really read /etc/passwd */
memset(&buf, 0, 10);
if (read(fd, &buf, 10) == -1) {
perror("Failure reading /etc/passwd pre-hat");
_exit(1);
}
buf[9] = '