I have not much experiance using ssh or unix commands and I am trying to alter some information in the 'bash_profile' on my linux server, I have access to do this. I log in as root using ssh from my Mac's terminal app. I read that to access this script I should use:
pico .bash_profile
on doing this I am told:
-bash: pico: command not found
root@ms1 [~]#
I am also trying to alter a ssh legal message using:
pico /etc/motd
but I get the same error.
Anyone any ideas on how I do this.
Many thanks
Editing .bash_profile from within the 'Macs' terminal app
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
He's SSH'ing to a linux box. vi (to me at least) requires supreme knowledge to use too... nano is easyredmonkey wrote:vi /etc/motd
vi .bash_profile
Not sure if they made any changes but the Mac I have has my bash profile in the file .profile
On all the recent verions of bash the file has been at ~/.bash_profile for me.
On the old redhat boxes at university I used to edit .profile so I guess it changed somewhere along the way
OK great, 'nano' got me in.
BTW, Yes, I am SSH'ing to a linux box.... from a Mac.
I get quite a few SSHD Authentication Failures: listed in the servers Logwatch, so as a safety alert 'I read' I could add the following line at the bottom of the 'bash_profile' to make the server notify me by e-mail if someone logged in as root:
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" your@email.com
To be honest I am a little nervous about doing this having the limited knowlage I do on SSH and Linux, but it seems like a good warning to have. Maybe some experianced users can confirm this is a good thing to do and that the command line is correct, I don't want to screw anything up.
Thanks
BTW, Yes, I am SSH'ing to a linux box.... from a Mac.
I get quite a few SSHD Authentication Failures: listed in the servers Logwatch, so as a safety alert 'I read' I could add the following line at the bottom of the 'bash_profile' to make the server notify me by e-mail if someone logged in as root:
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" your@email.com
To be honest I am a little nervous about doing this having the limited knowlage I do on SSH and Linux, but it seems like a good warning to have. Maybe some experianced users can confirm this is a good thing to do and that the command line is correct, I don't want to screw anything up.
Thanks
Last edited by mikebr on Wed Oct 19, 2005 3:38 am, edited 1 time in total.
imho, using vi is pure sm... use vim instead...
my ~/.bash_profile
my ~/.bashrc
my ~/.bash_profile
Code: Select all
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fiCode: Select all
umask 077
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
# If running interactively, then:
if [ "$PS1" ]; then
# enable color support of ls and also add handy aliases
eval `dircolors -b`
alias ls='ls --color=auto'
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
# set a fancy prompt
PS1='\u@\h:\w\$ '
fi