scp prompt when home directory is 777


 
Thread Tools Search this Thread
Operating Systems Solaris scp prompt when home directory is 777
# 1  
Old 09-01-2008
scp prompt when home directory is 777

Morning all, I was running some deployment scripts on Friday night that kept failing because it prompted for a password for a user I was already sudo'd in as when trying to scp a file onto itself.

e.g.

on server 51.123.123.123 as sudo dlam
typing: scp testfile dlam@51.123.123.123:/tmp
prompts for a password

Turned out that it was because the home directory for dlam had been set as permissions 777 instead of 755. When they are 755 there is no propt for a password and everything works fine.

So a simple question, is this a bug, or is there a good reason for this?

Cheers Smilie
# 2  
Old 09-01-2008
If your home dir is writable, somebody could replace the directory with your SSH keys; therefore, the daemon will not accept them.
# 3  
Old 09-01-2008
Hi. I can understand the home directory not being writeable without permissions, but why would it need a password to write to a /tmp directory?

Is it just a blanket ban from being able to scp any files to any directory for a user with 777 permissions in the home directory just to make sure you can't do any mischief?
# 4  
Old 09-01-2008
The authentication mechanism doesn't care what exactly you are trying to do; if you're not able to authenticate, you are not allowed in. It's more of an architectural issue than a philosophical stance, I guess (make authentication not depend on the later parts), but philosophically, too, it makes sense.
# 5  
Old 09-01-2008
Thank for that. It was baffilling trying to work out what the problem was on a Friday night/Saturday morning - and even more baffiling to find the problem but not understand why it was a problem

Cheers Smilie
# 6  
Old 09-06-2008
Likewise the user's ~/.ssh folder must be chmodded to 600 for SSH to cooperate for the same good security reasons.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies

2. Shell Programming and Scripting

How to pass password and prompt user for IP address while doing ssh and scp?

Hi All, I want to copy /.ssh/OM.pub file from source to destination. Here source IP address, username and password is always fixed. Whereas destination server IP address, password always gets changed. From destination server :- I am trying to write a script in which it should log in to... (3 Replies)
Discussion started by: madhur.baharani
3 Replies

3. Solaris

Unable to delete directory even with 777 perm

Hi, I have an 'empty' directory 'tmp' of which I am the owner and 777 permission. But when I try to delete the directory using rmdir or rm command, it gives error. Command prompt snapshot: => uname SunOS ... (4 Replies)
Discussion started by: platinum81
4 Replies

4. UNIX for Dummies Questions & Answers

scp not working because of prompt (AIX, tcsh)

Hello, I have this problem: I have a server to which I ssh, and it has a special prompt request. The prompt is done by a ?prompt command. It is fine with SSH, since the prompt I guess gets some input, but when I use SCP, the copy always fails. So, I was wondering if there is maybe a... (1 Reply)
Discussion started by: lastZenMaster
1 Replies

5. Shell Programming and Scripting

Prompt home made script

Hi I made a script called mydf which puts out the amount of storage space left on the file system; df | head -2 | tail -1 | tr -s " " | cut -d" " -f4 But I would like to run it with every new prompt, so you get something like; user@5518748~$ in your prompt (5518748 being the mydf output). Its... (2 Replies)
Discussion started by: mdop
2 Replies

6. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

7. Linux

Lock User in home directory in ftp prompt

Hi, I am using Red Hat Enterprise Linux ES release 4 (Nahant Update 5). Here I have created one user with /sbin/nologin shll such that login is not possible only ftp is possible. But I want to do another thing that the user can not roam around after ftp. I had tried one way. in... (4 Replies)
Discussion started by: kallol
4 Replies

8. Cybersecurity

can another user 777 and existing 777 dirctory?

User usrA creates dirA directory and runs chmod 777 on the directory. Can usrB issue another 777 on dirA? It appears the answer is no even if the usrA and usrB are part of the same group. I know this is a rare scenario but I just ran across it and found out that usrB receives an error when... (4 Replies)
Discussion started by: zlek131
4 Replies

9. OS X (Apple)

No command prompt after SSH/SCP

Recently whenever I log out of an SSH session, or copy something using SCP, I get no response from my shell. Running with ssh -v showed no errors when exiting. Normally I could deal with this, but I believe it's causing errors elsewhere when scripts try to download things from external... (0 Replies)
Discussion started by: keymakerOvvvv
0 Replies
Login or Register to Ask a Question