SCP and UMASK Linux Centos [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I need to control the transferring of files on my server. Some files are sent through scp to my server and I want such a files to have a specific set of permissions let's say 770. I tried pam_umask.so in /etc/pam.d/login and setting umask in /etc/profile but it seems to not work.
Which is the best way on Linux to force an umask for files transferred via scp?
Regards,
Andrea

AFAIK, scp does not initialize a shell, thus don't source any file such as .profile, .bashrc, /etc/profile.
So the only way of doing this, as commented by Stefan Ferstl, seems to use the pam module pam_umask.so.
The file /etc/pam.d/sshd is probably the best place to do it, if you want to limit this behavior to ssh sessions :
session optional pam_umask.so umask=0007

Related

Doas keeps asking me for password [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I installed Doas as a replacement for sudo on my Gentoo machine. I followed the documentation here and my /etc/doas.conf looks like this:
permit persist :wheel
I have also restarted the system. However, it still asks me for the password every time I use doas. What am I doing wrong?
You have to enable persist while you are compiling. Set persist use flag and it will work. If you have (persist) while you are compiling, you have to unmask the app-admin/doas first.
Make below changes in the doas configuration.
permit nopass ::wheel
or
allow user and dont require a password to execute commands as root
permit nopass keepenv :username2
Reference URL
https://forums.freebsd.org/threads/doas-tips-sudo-alternative.69409/
This works for me:
permit persist username as root

How to copy and paste an entire file across different Linux accounts? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I need to copy a configuration file from one linux account to another account. Since I do not have the permission I couldn't scp. So, how to yang and put the entire file across the accounts? File has 100s of lines so, it is not possible to copy, paste by mouse. I'm using putty.
If you can use PuTTY then you can use scp - both use the SSH protocol and require a user login.
Since you are comfortable using PuTTY, try using PSCP, which implements the scp linux command with a GUI. Use the same credentials as you do for PuTTY.

Not getting proper prompt when using SHH [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I logged into my account on Bluehost using SSH and I got an unusual prompt.
I expected it to show the directory and a typical prompt but instead got some bash.
What you're seeing is the default bash prompt. This is what you get when the distro doesn't provide a better one in /etc/profile or similar. You can get it on any platform by ignoring the environment and config files:
env -i bash --norc
To get the user#host:dir$ prompt that Debian and derived distros use, you can add
export PS1='\u#\h:\w\$ '
to your .bash_profile

How to modify .bash_login remotely? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I did something stupid which was adding the command exit 0 to .bash_login.
Now i'm stuck since whenever i try logging in, it just exits automatically.
Any ideas on how to resolve this? I'm currently using a windows PC to ssh to a linux plug computer.
ssh user#host "/bin/bash --noprofile"
See manpages for ssh and bash to see how this works. May need some modifications-- for example, if bash isn't in /bin on the remote machine. You will need a command-line ssh client, but I believe one is available for Cygwin on Windows.
After that, you should have a usable shell so you can fix your .bash_login.
Can you start a different shell?
ssh user#host tcsh
Then, in the different shell, fix or rename the file.

vim - config for me with multiple users on same machine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm editing files on a shared machine. How do I configure vim for me, while allowing other users their configuration (which may be 'unconfigured')?
(edit, should have noted this initially:) Unfortunately we all have to use the same login ID so config file in home directory isn't a solution for me. Is there an environment variable I could set manually after login to tell vim where to load "my" config?
Your configurations are in your ~/.vimrc in your home folder. Your settings are therefore unique to your username. You should have no problem with others on the machine.
EDIT: Since you can't use a home folder (why again?), you can launch vim with a custom configuration script with the following:
vim -u custom.vimrc
If you have a .bash_profile or something similar, you can alias this to your own custom vim.
alias vime='vim -u custom.vimrc'

Resources