Sponsored Content
Full Discussion: scp links! wrong permissions
Top Forums Shell Programming and Scripting scp links! wrong permissions Post 302461732 by halacil on Tuesday 12th of October 2010 06:12:04 AM
Old 10-12-2010
Now my server is not booting.

I get screen saying (none)login: ... if I enter root and press enter it comes back with the same prompt again and again!!
it also mentioned of init=/bin/sh and init cant execute /etc/x11/prefdm
init id x respawning too fast…
tried rebooting from the console by doing ctrl + alt +del but comes back with /cant open /var/run/shutdown.pid

I tried the following but no joy!
Inserted the linux installation cd.. ( rescue mode)...
Checked the permission on /bin and it was set to ?r- -rw-rx tried to do chmod –R 775 but got error operation not permitted ...
Already had backup of /bin so Untar’d the /bin/bin.tar and tried to over write the /bin but got this error: can not overwite /bin bin not a directory...
For some strange reason /bin is not own by root the owner and group name are both numeric, So i tried chown –R root but keep getting user root does not exist!
If I do id.. i can see that i have logged on as root and it does exist in /etc/passwd

Last edited by halacil; 10-12-2010 at 07:33 AM..
 

8 More Discussions You Might Find Interesting

1. Solaris

SCP from one solaris box to another without copying links

I am doing a scp (directory)from one solaris box to another.The problem is that all links present in that directory also get copied .I do not want the links to get copied .currently I am using following syntax scp -rvp pcserver info@appudemo.sea.us.wam.net:/home/info I checked the man... (1 Reply)
Discussion started by: u449064
1 Replies

2. UNIX for Advanced & Expert Users

About links

why directory has two links as default. what's the purpose? (1 Reply)
Discussion started by: nagalenoj
1 Replies

3. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

4. Debian

scp not preserving properties and links

I'm trying to get a number of old disks on HP-UX 10.2 copied over to a new Debian machine which has a NAS on it. The HP does not have rsync, but does have scp. Scp unfortunately does not always preserve permissions, and does not save links which were on the disk. Apparently rsync has a flag... (3 Replies)
Discussion started by: PasadenaDave
3 Replies

5. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

6. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

7. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

8. Shell Programming and Scripting

Why result is wrong here ? whether break statement is wrong ?

Hi ! all I am just trying to check range in my datafile pls tell me why its resulting wrong admin@IEEE:~/Desktop$ cat test.txt 0 28.4 5 28.4 10 28.4 15 28.5 20 28.5 25 28.6 30 28.6 35 28.7 40 28.7 45 28.7 50 28.8 55 28.8 60 28.8 65 28.1... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies
CP(1)							    BSD General Commands Manual 						     CP(1)

NAME
cp -- copy files SYNOPSIS
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory DESCRIPTION
In the first synopsis form, the cp utility copies the contents of the source_file to the target_file. In the second synopsis form, the con- tents of each named source_file is copied to the destination target_directory. The names of the files themselves are not changed. If cp detects an attempt to copy a file to itself, the copy will fail. The following options are available: -a Same as -pPR options. Preserves structure and attributes of files but not directory structure. -f If the destination file cannot be opened, remove it and create a new file, without prompting for confirmation regardless of its permis- sions. (The -f option overrides any previous -n option.) The target file is not unlinked before the copy. Thus, any existing access rights will be retained. -H If the -R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.) -i Cause cp to write a prompt to the standard error output before copying a file that would overwrite an existing file. If the response from the standard input begins with the character 'y' or 'Y', the file copy is attempted. (The -i option overrides any previous -n option.) -L If the -R option is specified, all symbolic links are followed. -n Do not overwrite an existing file. (The -n option overrides any previous -f or -i options.) -P If the -R option is specified, no symbolic links are followed. This is the default. -p Cause cp to preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions. Access Control Lists (ACLs) and Extended Attributes (EAs), including resource forks, will also be preserved. If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not altered. If the source file has its set-user-ID bit on and the user ID cannot be preserved, the set-user-ID bit is not preserved in the copy's permissions. If the source file has its set-group-ID bit on and the group ID cannot be preserved, the set-group-ID bit is not pre- served in the copy's permissions. If the source file has both its set-user-ID and set-group-ID bits on, and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are preserved in the copy's permissions. -R If source_file designates a directory, cp copies the directory and the entire subtree connected at that point. If the source_file ends in a /, the contents of the directory are copied rather than the directory itself. This option also causes symbolic links to be copied, rather than indirected through, and for cp to create special files rather than copying them as normal files. Created directo- ries have the same mode as the corresponding source directory, unmodified by the process' umask. In -R mode, cp will continue copying even if errors are detected. Note that cp copies hard-linked files as separate files. If you need to preserve hard links, consider using tar(1), cpio(1), or pax(1) instead. -v Cause cp to be verbose, showing files as they are copied. -X Do not copy Extended Attributes (EAs) or resource forks. -c copy files using clonefile(2) For each destination file that already exists, its contents are overwritten if permissions allow. Its mode, user ID, and group ID are unchanged unless the -p option was specified. In the second synopsis form, target_directory must exist unless there is only one named source_file which is a directory and the -R flag is specified. If the destination file does not exist, the mode of the source file is used as modified by the file mode creation mask (umask, see csh(1)). If the source file has its set-user-ID bit on, that bit is removed unless both the source file and the destination file are owned by the same user. If the source file has its set-group-ID bit on, that bit is removed unless both the source file and the destination file are in the same group and the user is a member of that group. If both the set-user-ID and set-group-ID bits are set, all of the above conditions must be fulfilled or both bits are removed. Appropriate permissions are required for file creation or overwriting. Symbolic links are always followed unless the -R flag is set, in which case symbolic links are not followed, by default. The -H or -L flags (in conjunction with the -R flag) cause symbolic links to be followed as described above. The -H, -L and -P options are ignored unless the -R option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. If cp receives a SIGINFO (see the status argument for stty(1)) signal, the current input and output file and the percentage complete will be written to the standard output. EXIT STATUS
The cp utility exits 0 on success, and >0 if an error occurs. COMPATIBILITY
Historic versions of the cp utility had a -r option. This implementation supports that option; however, its use is strongly discouraged, as it does not correctly copy special files, symbolic links, or fifo's. The -v and -n options are non-standard and their use in scripts is not recommended. LEGACY DESCRIPTION
In legacy mode, -f will override -i. Also, under the -f option, the target file is always unlinked before the copy. Thus, new access rights will always be set. In -R mode, copying will terminate if an error is encountered. For more information about legacy mode, see compat(5). SEE ALSO
mv(1), rcp(1), umask(2), fts(3), compat(5), symlink(7) STANDARDS
The cp command is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. HISTORY
A cp command appeared in Version 1 AT&T UNIX. BSD
February 23, 2005 BSD
All times are GMT -4. The time now is 10:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy